Update lint rules
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { FieldFunctionOptions } from '@apollo/client/cache';
|
||||
import { Reference } from '@apollo/client/utilities';
|
||||
import { MetaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { FieldFunctionOptions } from '@apollo/client/cache';
|
||||
import type { Reference } from '@apollo/client/utilities';
|
||||
import type { MetaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
type ReadFieldFunction = FieldFunctionOptions['readField'];
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { GqlMetaHolder, Metadata, MetadataHolderType } from '@/features/metadata/Metadata.types.ts';
|
||||
import type { GqlMetaHolder, Metadata, MetadataHolderType } from '@/features/metadata/Metadata.types.ts';
|
||||
import { convertFromGqlMeta } from '@/features/metadata/services/MetadataConverter.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { GET_GLOBAL_METADATAS } from '@/lib/graphql/metadata/GlobalMetadataQuery.ts';
|
||||
import {
|
||||
import type {
|
||||
GetGlobalMetadatasQuery,
|
||||
GetGlobalMetadatasQueryVariables,
|
||||
MetaInput,
|
||||
@@ -52,7 +52,9 @@ export class MetadataChunker {
|
||||
}
|
||||
|
||||
static getStaleChunkKeyCount(metadata: Metadata | undefined, fullKey: string): number {
|
||||
if (!metadata) return 0;
|
||||
if (!metadata) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const scanFrom = (index: number): number =>
|
||||
doesMetadataKeyExistIn(metadata, this.getChunkIndexKey(fullKey, index)) ? scanFrom(index + 1) : index;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MetaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { AllowedMetadataValueTypes, AppMetadataKeys, Metadata } from '@/features/metadata/Metadata.types.ts';
|
||||
import type { MetaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { AllowedMetadataValueTypes, AppMetadataKeys, Metadata } from '@/features/metadata/Metadata.types.ts';
|
||||
import { APP_METADATA } from '@/features/metadata/Metadata.constants.ts';
|
||||
|
||||
export const convertValueFromMetadata = <T extends AllowedMetadataValueTypes = AllowedMetadataValueTypes>(
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import type { useEffect } from 'react';
|
||||
import {
|
||||
APP_METADATA_KEY_PREFIX,
|
||||
METADATA_MIGRATIONS,
|
||||
VALID_APP_METADATA_KEYS,
|
||||
} from '@/features/metadata/Metadata.constants.ts';
|
||||
import {
|
||||
import type {
|
||||
AppMetadataKeys,
|
||||
IMetadataMigration,
|
||||
Metadata,
|
||||
@@ -21,13 +21,13 @@ import {
|
||||
MetadataKeyValuePair,
|
||||
} from '@/features/metadata/Metadata.types.ts';
|
||||
import { extractOriginalKey, getMetadataKey } from '@/features/metadata/Metadata.utils.ts';
|
||||
import { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import { CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import type { CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { getMetadataUpdateFunction } from '@/features/metadata/services/MetadataUpdater.ts';
|
||||
import { MetadataChunker } from '@/features/metadata/services/MetadataChunker.ts';
|
||||
import { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
import type { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import type { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
|
||||
const getAppKeyPrefixForMigration = (migrationId: number): string => {
|
||||
const appKeyPrefix = METADATA_MIGRATIONS.slice(0, migrationId)
|
||||
|
||||
@@ -6,23 +6,23 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import type { useEffect } from 'react';
|
||||
import { convertValueFromMetadata } from '@/features/metadata/services/MetadataConverter.ts';
|
||||
import {
|
||||
import type {
|
||||
AllowedMetadataValueTypes,
|
||||
AppMetadataKeys,
|
||||
Metadata,
|
||||
MetadataHolder,
|
||||
MetadataHolderType,
|
||||
} from '@/features/metadata/Metadata.types.ts';
|
||||
import { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
|
||||
import { CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
import type { CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
import { doesMetadataKeyExistIn, getMetadataKey } from '@/features/metadata/Metadata.utils.ts';
|
||||
import { MetadataChunker } from '@/features/metadata/services/MetadataChunker.ts';
|
||||
import { applyMetadataMigrations } from '@/features/metadata/services/MetadataMigrations.ts';
|
||||
import { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
import type { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import type { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
import { APP_METADATA } from '@/features/metadata/Metadata.constants.ts';
|
||||
import { MetadataValueCache } from '@/features/metadata/services/MetadataValueCache.ts';
|
||||
|
||||
|
||||
@@ -7,21 +7,21 @@
|
||||
*/
|
||||
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
import {
|
||||
import type { CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
import type {
|
||||
AppMetadataKeys,
|
||||
GqlMetaHolder,
|
||||
MetadataHolder,
|
||||
MetadataHolderType,
|
||||
MetadataKeyValuePair,
|
||||
} from '@/features/metadata/Metadata.types.ts';
|
||||
import { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import { getMetadataKey } from '@/features/metadata/Metadata.utils.ts';
|
||||
import { convertToGqlMeta } from '@/features/metadata/services/MetadataConverter.ts';
|
||||
import { MetadataChunker } from '@/features/metadata/services/MetadataChunker.ts';
|
||||
import { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
import { MetaInput } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import type { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
import type { MetaInput } from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
type MetadataUpdateOptions = {
|
||||
update?: MetadataKeyValuePair[];
|
||||
@@ -189,7 +189,9 @@ const requestBatchMetadataUpdate = async (
|
||||
holderType: MetadataHolderType,
|
||||
entries: Array<{ metadataHolders: GqlMetaHolder[]; options: MetadataUpdateOptions }>,
|
||||
): Promise<void> => {
|
||||
if (entries.length === 0) return;
|
||||
if (entries.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const processed = entries.flatMap(({ metadataHolders, options }) =>
|
||||
metadataHolders.map((metadataHolder) => ({
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MetadataHolderType } from '@/features/metadata/Metadata.types.ts';
|
||||
import type { MetadataHolderType } from '@/features/metadata/Metadata.types.ts';
|
||||
|
||||
export class MetadataValueCache {
|
||||
private static convertedValueByKey = new Map<string, unknown>();
|
||||
|
||||
Reference in New Issue
Block a user