Drop the mutation and sequential-await rules and the stale directives. [skip build]
This commit is contained in:
@@ -70,7 +70,6 @@ async function fetchSpaceHierarchy(mx: MatrixClient, spaceId: string): Promise<I
|
||||
|
||||
while (pageCount < MAX_PAGES) {
|
||||
try {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const result = await mx.getRoomHierarchy(
|
||||
spaceId,
|
||||
PER_PAGE_COUNT,
|
||||
|
||||
@@ -454,7 +454,6 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => {
|
||||
|
||||
let token: string | undefined = eventContext.start;
|
||||
while (token) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const response = await mx.createMessagesRequest(
|
||||
room.roomId,
|
||||
token,
|
||||
@@ -475,7 +474,6 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => {
|
||||
|
||||
const eventIds = eventsToDelete.map((roomEvent) => roomEvent.event_id);
|
||||
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await rateLimitedActions(eventIds, (eventId) =>
|
||||
mx.redactEvent(room.roomId, eventId, undefined, { reason }),
|
||||
);
|
||||
|
||||
@@ -46,12 +46,10 @@ const fillMissingPowers = (powerLevels: IPowerLevels): IPowerLevels =>
|
||||
const keys = Object.keys(DEFAULT_POWER_LEVELS) as unknown as (keyof IPowerLevels)[];
|
||||
keys.forEach((key) => {
|
||||
if (draftPl[key] === undefined) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
draftPl[key] = DEFAULT_POWER_LEVELS[key] as any;
|
||||
}
|
||||
});
|
||||
if (draftPl.notifications && typeof draftPl.notifications.room !== 'number') {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
draftPl.notifications.room = DEFAULT_POWER_LEVELS.notifications.room;
|
||||
}
|
||||
return draftPl;
|
||||
@@ -236,23 +234,19 @@ export const applyPermissionPower = (
|
||||
if (typeof location.key === 'string') {
|
||||
const users = powerLevels.users ?? {};
|
||||
users[location.key] = power;
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
powerLevels.users = users;
|
||||
return powerLevels;
|
||||
}
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
powerLevels.users_default = power;
|
||||
return powerLevels;
|
||||
}
|
||||
if ('action' in location) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
powerLevels[location.key] = power;
|
||||
return powerLevels;
|
||||
}
|
||||
if ('notification' in location) {
|
||||
const notifications = powerLevels.notifications ?? {};
|
||||
notifications[location.key] = power;
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
powerLevels.notifications = notifications;
|
||||
return powerLevels;
|
||||
}
|
||||
@@ -260,11 +254,9 @@ export const applyPermissionPower = (
|
||||
if (typeof location.key === 'string') {
|
||||
const events = powerLevels.events ?? {};
|
||||
events[location.key] = power;
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
powerLevels.events = events;
|
||||
return powerLevels;
|
||||
}
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
powerLevels.state_default = power;
|
||||
return powerLevels;
|
||||
}
|
||||
@@ -272,11 +264,9 @@ export const applyPermissionPower = (
|
||||
if (typeof location.key === 'string') {
|
||||
const events = powerLevels.events ?? {};
|
||||
events[location.key] = power;
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
powerLevels.events = events;
|
||||
return powerLevels;
|
||||
}
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
powerLevels.events_default = power;
|
||||
return powerLevels;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user