[skip ci] Re-add removed lint rules
This commit is contained in:
@@ -32,7 +32,7 @@ export const useBackButton = () => {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const previousPage = historyToCheck.slice(-2)[0];
|
||||
const [previousPage] = historyToCheck.slice(-2);
|
||||
|
||||
const isPreviousPageCurrentPage = previousPage === location.pathname;
|
||||
const ignorePreviousPage = PAGES_TO_IGNORE.some((page) => !!previousPage.match(page));
|
||||
|
||||
@@ -162,7 +162,7 @@ export function Sources({ tabsMenuHeight }: { tabsMenuHeight: number }) {
|
||||
);
|
||||
}}
|
||||
itemContent={(index, groupIndex) => {
|
||||
const language = sourcesByLanguage[groupIndex][0];
|
||||
const [language] = sourcesByLanguage[groupIndex];
|
||||
const source = visibleSources[index];
|
||||
|
||||
return (
|
||||
|
||||
@@ -86,7 +86,7 @@ const handleDownload = async (
|
||||
return;
|
||||
}
|
||||
|
||||
const mangaId = mangaIds[0];
|
||||
const [mangaId] = mangaIds;
|
||||
const manga = Mangas.getFromCache(
|
||||
mangaId,
|
||||
gql`
|
||||
|
||||
@@ -86,8 +86,7 @@ export const useManageMangaLibraryState = (
|
||||
|
||||
let showAddToLibraryCategorySelectDialog: boolean;
|
||||
try {
|
||||
showAddToLibraryCategorySelectDialog = (await getMetadataServerSettings())
|
||||
.showAddToLibraryCategorySelectDialog;
|
||||
({ showAddToLibraryCategorySelectDialog } = await getMetadataServerSettings());
|
||||
} catch (e) {
|
||||
makeToast(t`Unable to load data`, 'error', getErrorMessage(e));
|
||||
return;
|
||||
|
||||
@@ -175,7 +175,7 @@ const getOutdatedMetadataKeys = (metadata: Metadata | undefined, migrationId: nu
|
||||
);
|
||||
|
||||
return Object.keys(metadata).filter((key) => {
|
||||
const appKeyPrefixOfKey = key.split('_')[0];
|
||||
const [appKeyPrefixOfKey] = key.split('_');
|
||||
|
||||
const isMetadataKeyOfApp = [...oldAppKeyPrefixes, APP_METADATA_KEY_PREFIX].includes(appKeyPrefixOfKey);
|
||||
if (!isMetadataKeyOfApp) {
|
||||
@@ -367,7 +367,7 @@ export const applyMetadataMigrations = (
|
||||
|
||||
METADATA_MIGRATIONS.forEach((migration, index) => {
|
||||
const migrationId = index + 1;
|
||||
const metadataToMigrate = migrationToMetadata[migrationId - 1][1];
|
||||
const [, metadataToMigrate] = migrationToMetadata[migrationId - 1];
|
||||
|
||||
const isMigrationRequired = appliedMigrationId < migrationId;
|
||||
if (!isMigrationRequired) {
|
||||
|
||||
@@ -79,9 +79,9 @@ export class Queue {
|
||||
}
|
||||
|
||||
private getNextItemToProcess<T>(): { key: Key; fn: QueueItemFunction<T>; promise: ControlledPromise<T> } {
|
||||
const [key] = [...this.pendingKeyToPriorityMap.entries()].toSorted(
|
||||
const [[key]] = [...this.pendingKeyToPriorityMap.entries()].toSorted(
|
||||
([, priorityA], [, priorityB]) => priorityB - priorityA,
|
||||
)[0];
|
||||
);
|
||||
const fn = this.pendingKeyToFnMap.get(key) as () => PromiseLike<T> | T;
|
||||
const promise = this.pendingKeyToPromiseMap.get(key) as ControlledPromise<T>;
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ export class ZustandUtil {
|
||||
const fn = args[0] as (state: unknown) => unknown;
|
||||
selector = sliceKey !== undefined ? (state: State) => fn(state[sliceKey]) : fn;
|
||||
} else if (args.length === 1) {
|
||||
const key = args[0];
|
||||
const [key] = args;
|
||||
selector =
|
||||
sliceKey !== undefined
|
||||
? (state: State) => (state[sliceKey] as Record<PropertyKey, unknown>)[key as PropertyKey]
|
||||
@@ -66,7 +66,7 @@ export class ZustandUtil {
|
||||
|
||||
static createActionName(...names: string[]) {
|
||||
const storeAndSlices = names.slice(0, -1);
|
||||
const action = names.slice(-1)[0];
|
||||
const [action] = names.slice(-1);
|
||||
|
||||
return `${storeAndSlices.join(':')}/${action}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user