From d06fed3bb10831d056a5024e922f52fb3833a6bc Mon Sep 17 00:00:00 2001 From: Nathaniel Tucker Date: Sun, 1 Dec 2024 17:39:17 +0000 Subject: [PATCH] internal: Formatting --- packages/core/src/controller/Controller.ts | 2 +- packages/core/src/manager/DevtoolsManager.ts | 5 ++--- .../core/src/manager/PollingSubscription.ts | 18 +++++++++--------- .../core/src/manager/SubscriptionManager.ts | 2 +- packages/endpoint/src/__tests__/endpoint.ts | 2 +- .../src/__tests__/validateRequired.test.ts | 2 +- packages/endpoint/src/schemas/Collection.ts | 4 ++-- packages/endpoint/src/schemas/Entity.ts | 2 +- packages/endpoint/src/schemas/Invalidate.ts | 3 +-- packages/endpoint/src/schemas/Polymorphic.ts | 2 +- .../endpoint/src/schemas/__tests__/All.test.ts | 2 +- .../src/schemas/__tests__/Array.test.js | 2 +- .../src/schemas/__tests__/Entity.test.ts | 2 +- .../src/schemas/__tests__/Invalidate.test.ts | 2 +- .../src/schemas/__tests__/Object.test.js | 2 +- .../src/schemas/__tests__/Query.test.ts | 2 +- .../src/schemas/__tests__/Serializable.test.ts | 2 +- .../src/schemas/__tests__/Union.test.js | 2 +- .../src/schemas/__tests__/Values.test.js | 2 +- packages/graphql/src/__tests__/gql.ts | 1 - packages/normalizr/src/__tests__/MemoCache.ts | 2 +- packages/normalizr/src/__tests__/index.test.js | 2 +- packages/normalizr/src/memo/globalCache.ts | 6 +++--- .../normalizr/src/normalizr/addEntities.ts | 1 - packages/normalizr/src/normalizr/normalize.ts | 1 - .../src/components/BackupLoading.native.js | 1 - .../react/src/components/ErrorBoundary.tsx | 2 +- .../src/hooks/__tests__/useDLE.native.tsx | 2 +- .../src/hooks/__tests__/useFetch.native.tsx | 2 +- .../react/src/hooks/__tests__/useFetch.web.tsx | 2 +- packages/react/src/hooks/useCache.ts | 1 - packages/react/src/hooks/useDLE.native.ts | 1 - packages/react/src/hooks/useDLE.ts | 1 - packages/react/src/hooks/useError.ts | 1 - packages/react/src/hooks/useFetch.native.ts | 1 - packages/react/src/hooks/useFetch.ts | 1 - packages/react/src/hooks/useLive.ts | 2 +- packages/react/src/hooks/useQuery.ts | 1 - .../react/src/hooks/useSubscription.native.tsx | 2 -- packages/react/src/hooks/useSuspense.native.ts | 1 - packages/react/src/hooks/useSuspense.ts | 1 - packages/react/src/hooks/useUniversal.ts | 1 - .../react/src/managers/__tests__/RIC.web.ts | 4 ++-- .../createPersistedStoreServer.tsx | 2 +- packages/rest/src/__tests__/RestEndpoint.ts | 1 - .../createPersistedStoreServer.tsx | 2 +- 46 files changed, 43 insertions(+), 62 deletions(-) diff --git a/packages/core/src/controller/Controller.ts b/packages/core/src/controller/Controller.ts index d6ef72b86ad4..82cd1b992ad9 100644 --- a/packages/core/src/controller/Controller.ts +++ b/packages/core/src/controller/Controller.ts @@ -464,7 +464,7 @@ export default class Controller< } // second argument is false if any entities are missing - // eslint-disable-next-line prefer-const + const { data, paths } = this.memo.denormalize( schema, input, diff --git a/packages/core/src/manager/DevtoolsManager.ts b/packages/core/src/manager/DevtoolsManager.ts index 721d01ca6384..5416a559bbc1 100644 --- a/packages/core/src/manager/DevtoolsManager.ts +++ b/packages/core/src/manager/DevtoolsManager.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-inner-declarations */ import type { DevToolsConfig } from './devtoolsTypes.js'; import type { Controller, EndpointInterface } from '../index.js'; import type { Middleware } from '../middlewareTypes.js'; @@ -90,10 +89,10 @@ if (process.env.NODE_ENV !== 'production') { */ export default class DevToolsManager implements Manager { declare middleware: Middleware; - protected declare devTools: undefined | any; + declare protected devTools: undefined | any; protected started = false; protected actions: [ActionTypes, State][] = []; - protected declare controller: Controller; + declare protected controller: Controller; declare skipLogging?: (action: ActionTypes) => boolean; maxBufferLength = 100; diff --git a/packages/core/src/manager/PollingSubscription.ts b/packages/core/src/manager/PollingSubscription.ts index 6ea9b51a65d6..6f59af9d9388 100644 --- a/packages/core/src/manager/PollingSubscription.ts +++ b/packages/core/src/manager/PollingSubscription.ts @@ -14,16 +14,16 @@ import type { SubscribeAction } from '../types.js'; * @see https://dataclient.io/docs/api/PollingSubscription */ export default class PollingSubscription implements Subscription { - protected declare readonly endpoint: EndpointInterface; - protected declare readonly args: readonly any[]; - protected declare readonly key: string; - protected declare frequency: number; + declare protected readonly endpoint: EndpointInterface; + declare protected readonly args: readonly any[]; + declare protected readonly key: string; + declare protected frequency: number; protected frequencyHistogram: Map = new Map(); - protected declare controller: Controller; - protected declare intervalId?: ReturnType; - protected declare lastIntervalId?: ReturnType; - protected declare startId?: ReturnType; - private declare connectionListener: ConnectionListener; + declare protected controller: Controller; + declare protected intervalId?: ReturnType; + declare protected lastIntervalId?: ReturnType; + declare protected startId?: ReturnType; + declare private connectionListener: ConnectionListener; constructor( action: Omit, diff --git a/packages/core/src/manager/SubscriptionManager.ts b/packages/core/src/manager/SubscriptionManager.ts index 574b7e130431..9fd0e7154cf7 100644 --- a/packages/core/src/manager/SubscriptionManager.ts +++ b/packages/core/src/manager/SubscriptionManager.ts @@ -40,7 +40,7 @@ export default class SubscriptionManager< [key: string]: InstanceType; } = {}; - protected declare readonly Subscription: S; + declare protected readonly Subscription: S; protected controller: Controller = new Controller(); constructor(Subscription: S) { diff --git a/packages/endpoint/src/__tests__/endpoint.ts b/packages/endpoint/src/__tests__/endpoint.ts index d328c61fda28..1bfed8eb8da8 100644 --- a/packages/endpoint/src/__tests__/endpoint.ts +++ b/packages/endpoint/src/__tests__/endpoint.ts @@ -7,7 +7,7 @@ import Entity from '../schemas/Entity'; describe.each([true, false])(`Endpoint (CSP %s)`, mockCSP => { jest.resetModules(); jest.mock('../CSP', () => ({ CSP: mockCSP })); - // eslint-disable-next-line @typescript-eslint/no-var-requires + const Endpoint: typeof TEndpoint = require('../endpoint').default; afterAll(() => { jest.clearAllMocks(); diff --git a/packages/endpoint/src/__tests__/validateRequired.test.ts b/packages/endpoint/src/__tests__/validateRequired.test.ts index 4d02e3ac545d..7593fff66807 100644 --- a/packages/endpoint/src/__tests__/validateRequired.test.ts +++ b/packages/endpoint/src/__tests__/validateRequired.test.ts @@ -9,7 +9,7 @@ import validateRequired from '../validateRequired'; let dateSpy: jest.SpyInstance; beforeAll(() => { dateSpy = jest - // eslint-disable-next-line no-undef + .spyOn(global.Date, 'now') .mockImplementation(() => new Date('2019-05-14T11:01:58.135Z').valueOf()); }); diff --git a/packages/endpoint/src/schemas/Collection.ts b/packages/endpoint/src/schemas/Collection.ts index 8bddda82d1bb..36f14e2f483e 100644 --- a/packages/endpoint/src/schemas/Collection.ts +++ b/packages/endpoint/src/schemas/Collection.ts @@ -24,9 +24,9 @@ export default class CollectionSchema< Args extends any[] = DefaultArgs, Parent = any, > { - protected declare nestKey: (parent: any, key: string) => Record; + declare protected nestKey: (parent: any, key: string) => Record; - protected declare argsKey?: (...args: any) => Record; + declare protected argsKey?: (...args: any) => Record; declare readonly schema: S; diff --git a/packages/endpoint/src/schemas/Entity.ts b/packages/endpoint/src/schemas/Entity.ts index 5428634e271b..35e55c4361e3 100644 --- a/packages/endpoint/src/schemas/Entity.ts +++ b/packages/endpoint/src/schemas/Entity.ts @@ -22,7 +22,7 @@ export default abstract class Entity extends EntityMixin(EmptyBase) { * * Note: this only applies to non-nested members. */ - protected declare static automaticValidation?: 'warn' | 'silent'; + declare protected static automaticValidation?: 'warn' | 'silent'; /** Factory method to convert from Plain JS Objects. * diff --git a/packages/endpoint/src/schemas/Invalidate.ts b/packages/endpoint/src/schemas/Invalidate.ts index 9f292780969d..603587123b73 100644 --- a/packages/endpoint/src/schemas/Invalidate.ts +++ b/packages/endpoint/src/schemas/Invalidate.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import type { EntityInterface, SchemaSimple } from '../interface.js'; import type { AbstractInstanceType } from '../normal.js'; import { INVALID } from '../special.js'; @@ -16,7 +15,7 @@ export default class Invalidate< }, > implements SchemaSimple { - protected declare _entity: E; + declare protected _entity: E; /** * Marks entity as Invalid. diff --git a/packages/endpoint/src/schemas/Polymorphic.ts b/packages/endpoint/src/schemas/Polymorphic.ts index f0e5cf03f3df..8f14b5a37dec 100644 --- a/packages/endpoint/src/schemas/Polymorphic.ts +++ b/packages/endpoint/src/schemas/Polymorphic.ts @@ -2,7 +2,7 @@ import { isImmutable } from './ImmutableUtils.js'; import { Visit } from '../interface.js'; export default class PolymorphicSchema { - private declare _schemaAttribute: any; + declare private _schemaAttribute: any; protected schema: any; constructor( diff --git a/packages/endpoint/src/schemas/__tests__/All.test.ts b/packages/endpoint/src/schemas/__tests__/All.test.ts index 9c61eeb31f90..90b9e26da2d7 100644 --- a/packages/endpoint/src/schemas/__tests__/All.test.ts +++ b/packages/endpoint/src/schemas/__tests__/All.test.ts @@ -9,7 +9,7 @@ import { INVALID } from '../../special'; let dateSpy: jest.SpyInstance; beforeAll(() => { dateSpy = jest - // eslint-disable-next-line no-undef + .spyOn(global.Date, 'now') .mockImplementation(() => new Date('2019-05-14T11:01:58.135Z').valueOf()); }); diff --git a/packages/endpoint/src/schemas/__tests__/Array.test.js b/packages/endpoint/src/schemas/__tests__/Array.test.js index d0d69e9e21d8..0b4a2db22909 100644 --- a/packages/endpoint/src/schemas/__tests__/Array.test.js +++ b/packages/endpoint/src/schemas/__tests__/Array.test.js @@ -8,7 +8,7 @@ import { schema } from '../../'; let dateSpy; beforeAll(() => { dateSpy = jest - // eslint-disable-next-line no-undef + .spyOn(global.Date, 'now') .mockImplementation(() => new Date('2019-05-14T11:01:58.135Z').valueOf()); }); diff --git a/packages/endpoint/src/schemas/__tests__/Entity.test.ts b/packages/endpoint/src/schemas/__tests__/Entity.test.ts index 8b22bfb61bbb..b50f8c9285a0 100644 --- a/packages/endpoint/src/schemas/__tests__/Entity.test.ts +++ b/packages/endpoint/src/schemas/__tests__/Entity.test.ts @@ -13,7 +13,7 @@ import Entity from '../Entity'; let dateSpy: jest.SpyInstance; beforeAll(() => { dateSpy = jest - // eslint-disable-next-line no-undef + .spyOn(global.Date, 'now') .mockImplementation(() => new Date('2019-05-14T11:01:58.135Z').valueOf()); }); diff --git a/packages/endpoint/src/schemas/__tests__/Invalidate.test.ts b/packages/endpoint/src/schemas/__tests__/Invalidate.test.ts index ea6c24f1c27a..e92faff870f9 100644 --- a/packages/endpoint/src/schemas/__tests__/Invalidate.test.ts +++ b/packages/endpoint/src/schemas/__tests__/Invalidate.test.ts @@ -11,7 +11,7 @@ import Entity from '../Entity'; let dateSpy: jest.SpyInstance; beforeAll(() => { dateSpy = jest - // eslint-disable-next-line no-undef + .spyOn(global.Date, 'now') .mockImplementation(() => new Date('2019-05-14T11:01:58.135Z').valueOf()); }); diff --git a/packages/endpoint/src/schemas/__tests__/Object.test.js b/packages/endpoint/src/schemas/__tests__/Object.test.js index b1b594b4069e..e73dd2438ef4 100644 --- a/packages/endpoint/src/schemas/__tests__/Object.test.js +++ b/packages/endpoint/src/schemas/__tests__/Object.test.js @@ -10,7 +10,7 @@ import Entity from '../Entity'; let dateSpy; beforeAll(() => { dateSpy = jest - // eslint-disable-next-line no-undef + .spyOn(global.Date, 'now') .mockImplementation(() => new Date('2019-05-14T11:01:58.135Z').valueOf()); }); diff --git a/packages/endpoint/src/schemas/__tests__/Query.test.ts b/packages/endpoint/src/schemas/__tests__/Query.test.ts index 7eae1389a043..298966590759 100644 --- a/packages/endpoint/src/schemas/__tests__/Query.test.ts +++ b/packages/endpoint/src/schemas/__tests__/Query.test.ts @@ -10,7 +10,7 @@ import { schema, DenormalizeNullable } from '../..'; let dateSpy: jest.SpyInstance; beforeAll(() => { dateSpy = jest - // eslint-disable-next-line no-undef + .spyOn(global.Date, 'now') .mockImplementation(() => new Date('2019-05-14T11:01:58.135Z').valueOf()); }); diff --git a/packages/endpoint/src/schemas/__tests__/Serializable.test.ts b/packages/endpoint/src/schemas/__tests__/Serializable.test.ts index a60cf181ad7d..6d2c231d6560 100644 --- a/packages/endpoint/src/schemas/__tests__/Serializable.test.ts +++ b/packages/endpoint/src/schemas/__tests__/Serializable.test.ts @@ -8,7 +8,7 @@ import SimpleMemoCache from './denormalize'; let dateSpy; beforeAll(() => { dateSpy = jest - // eslint-disable-next-line no-undef + .spyOn(global.Date, 'now') .mockImplementation(() => new Date('2019-05-14T11:01:58.135Z').valueOf()); }); diff --git a/packages/endpoint/src/schemas/__tests__/Union.test.js b/packages/endpoint/src/schemas/__tests__/Union.test.js index e39c203e8078..317fe0ce3873 100644 --- a/packages/endpoint/src/schemas/__tests__/Union.test.js +++ b/packages/endpoint/src/schemas/__tests__/Union.test.js @@ -10,7 +10,7 @@ import { schema } from '../../'; let dateSpy; beforeAll(() => { dateSpy = jest - // eslint-disable-next-line no-undef + .spyOn(global.Date, 'now') .mockImplementation(() => new Date('2019-05-14T11:01:58.135Z').valueOf()); }); diff --git a/packages/endpoint/src/schemas/__tests__/Values.test.js b/packages/endpoint/src/schemas/__tests__/Values.test.js index 89ed33eaa224..0f41a4f76160 100644 --- a/packages/endpoint/src/schemas/__tests__/Values.test.js +++ b/packages/endpoint/src/schemas/__tests__/Values.test.js @@ -11,7 +11,7 @@ import Entity from '../Entity'; let dateSpy; beforeAll(() => { dateSpy = jest - // eslint-disable-next-line no-undef + .spyOn(global.Date, 'now') .mockImplementation(() => new Date('2019-05-14T11:01:58.135Z').valueOf()); }); diff --git a/packages/graphql/src/__tests__/gql.ts b/packages/graphql/src/__tests__/gql.ts index 63385757ebc9..e8bd0a0d8ed5 100644 --- a/packages/graphql/src/__tests__/gql.ts +++ b/packages/graphql/src/__tests__/gql.ts @@ -231,7 +231,6 @@ describe('GQLEndpoint', () => { expect(error).toBeDefined(); expect(error.status).toBe(400); - // eslint-disable-next-line require-atomic-updates console.error = oldError; }); }); diff --git a/packages/normalizr/src/__tests__/MemoCache.ts b/packages/normalizr/src/__tests__/MemoCache.ts index 42ab58e4a786..71cd7cfda98b 100644 --- a/packages/normalizr/src/__tests__/MemoCache.ts +++ b/packages/normalizr/src/__tests__/MemoCache.ts @@ -26,7 +26,7 @@ class Tacos extends IDEntity { let dateSpy; beforeAll(() => { dateSpy = jest - // eslint-disable-next-line no-undef + .spyOn(global.Date, 'now') .mockImplementation(() => new Date('2019-05-14T11:01:58.135Z').valueOf()); }); diff --git a/packages/normalizr/src/__tests__/index.test.js b/packages/normalizr/src/__tests__/index.test.js index 2a8c960d86f9..806414b4ecbd 100644 --- a/packages/normalizr/src/__tests__/index.test.js +++ b/packages/normalizr/src/__tests__/index.test.js @@ -21,7 +21,7 @@ class Tacos extends IDEntity { let dateSpy; beforeAll(() => { dateSpy = jest - // eslint-disable-next-line no-undef + .spyOn(global.Date, 'now') .mockImplementation(() => new Date('2019-05-14T11:01:58.135Z').valueOf()); }); diff --git a/packages/normalizr/src/memo/globalCache.ts b/packages/normalizr/src/memo/globalCache.ts index 5195be1ad04b..ee88657e78cf 100644 --- a/packages/normalizr/src/memo/globalCache.ts +++ b/packages/normalizr/src/memo/globalCache.ts @@ -11,13 +11,13 @@ export default class GlobalCache implements Cache { private cycleIndex = -1; private localCache: Record> = {}; - private declare getCache: ( + declare private getCache: ( pk: string, schema: EntityInterface, ) => WeakDependencyMap; - private declare _getEntity: GetEntity; - private declare resultCache: EndpointsCache; + declare private _getEntity: GetEntity; + declare private resultCache: EndpointsCache; constructor( getEntity: GetEntity, diff --git a/packages/normalizr/src/normalizr/addEntities.ts b/packages/normalizr/src/normalizr/addEntities.ts index 619aeeab6b50..3200aefda186 100644 --- a/packages/normalizr/src/normalizr/addEntities.ts +++ b/packages/normalizr/src/normalizr/addEntities.ts @@ -107,7 +107,6 @@ function handleIndexes( if (index in entity) { indexMap[entity[index]] = id; } /* istanbul ignore next */ else if ( - // eslint-disable-next-line no-undef process.env.NODE_ENV !== 'production' ) { console.warn(`Index not found in entity. Indexes must be top-level members of your entity. diff --git a/packages/normalizr/src/normalizr/normalize.ts b/packages/normalizr/src/normalizr/normalize.ts index 7c65547445f5..3f14084d3185 100644 --- a/packages/normalizr/src/normalizr/normalize.ts +++ b/packages/normalizr/src/normalizr/normalize.ts @@ -9,7 +9,6 @@ import type { StoreData, } from '../types.js'; -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export const normalize = < S extends Schema = Schema, E extends Record | undefined> = Record< diff --git a/packages/react/src/components/BackupLoading.native.js b/packages/react/src/components/BackupLoading.native.js index 66460733471a..e4d17bc91127 100644 --- a/packages/react/src/components/BackupLoading.native.js +++ b/packages/react/src/components/BackupLoading.native.js @@ -1,4 +1,3 @@ -/* eslint-disable react/prop-types */ import React, { useEffect } from 'react'; import { Text, Linking, View } from 'react-native'; diff --git a/packages/react/src/components/ErrorBoundary.tsx b/packages/react/src/components/ErrorBoundary.tsx index 6daeb9d68f4d..a075852e2640 100644 --- a/packages/react/src/components/ErrorBoundary.tsx +++ b/packages/react/src/components/ErrorBoundary.tsx @@ -36,7 +36,7 @@ export default class ErrorBoundary extends React.Component< return { error }; } - private declare unsubscribe: undefined | (() => void); + declare private unsubscribe: undefined | (() => void); state: ErrorState = {}; componentDidMount() { diff --git a/packages/react/src/hooks/__tests__/useDLE.native.tsx b/packages/react/src/hooks/__tests__/useDLE.native.tsx index 60708bf40378..4c78a8f6022b 100644 --- a/packages/react/src/hooks/__tests__/useDLE.native.tsx +++ b/packages/react/src/hooks/__tests__/useDLE.native.tsx @@ -198,7 +198,7 @@ describe('useDLE', () => { rerender(); await result.current; expect(fetchMock).toHaveBeenCalledTimes(0); - // eslint-disable-next-line require-atomic-updates + time += 610000000; rerender(); await result.current; diff --git a/packages/react/src/hooks/__tests__/useFetch.native.tsx b/packages/react/src/hooks/__tests__/useFetch.native.tsx index c3ca27470d59..2db8a46a727e 100644 --- a/packages/react/src/hooks/__tests__/useFetch.native.tsx +++ b/packages/react/src/hooks/__tests__/useFetch.native.tsx @@ -181,7 +181,7 @@ describe('useFetch', () => { rerender(); await result.current; expect(fetchMock).toHaveBeenCalledTimes(0); - // eslint-disable-next-line require-atomic-updates + time += 610000000; rerender(); await result.current; diff --git a/packages/react/src/hooks/__tests__/useFetch.web.tsx b/packages/react/src/hooks/__tests__/useFetch.web.tsx index cf500b22c59f..d36356b0f0c4 100644 --- a/packages/react/src/hooks/__tests__/useFetch.web.tsx +++ b/packages/react/src/hooks/__tests__/useFetch.web.tsx @@ -171,7 +171,7 @@ describe('useFetch', () => { rerender(); await result.current; expect(fetchMock).toHaveBeenCalledTimes(0); - // eslint-disable-next-line require-atomic-updates + time += 610000000; rerender(); await result.current; diff --git a/packages/react/src/hooks/useCache.ts b/packages/react/src/hooks/useCache.ts index 2233f08ad03e..e0923131757e 100644 --- a/packages/react/src/hooks/useCache.ts +++ b/packages/react/src/hooks/useCache.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import type { EndpointInterface, DenormalizeNullable, diff --git a/packages/react/src/hooks/useDLE.native.ts b/packages/react/src/hooks/useDLE.native.ts index a84c5e9a3ce2..f604454815c3 100644 --- a/packages/react/src/hooks/useDLE.native.ts +++ b/packages/react/src/hooks/useDLE.native.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import type { Denormalize, DenormalizeNullable, diff --git a/packages/react/src/hooks/useDLE.ts b/packages/react/src/hooks/useDLE.ts index 90f58015ffbb..bddbedae74d7 100644 --- a/packages/react/src/hooks/useDLE.ts +++ b/packages/react/src/hooks/useDLE.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import type { Denormalize, DenormalizeNullable, diff --git a/packages/react/src/hooks/useError.ts b/packages/react/src/hooks/useError.ts index 99f9043c9ae3..a8a3e1468322 100644 --- a/packages/react/src/hooks/useError.ts +++ b/packages/react/src/hooks/useError.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import type { NetworkError, UnknownError } from '@data-client/core'; import { EndpointInterface } from '@data-client/core'; diff --git a/packages/react/src/hooks/useFetch.native.ts b/packages/react/src/hooks/useFetch.native.ts index c2c63572ecbc..a3b03aeff797 100644 --- a/packages/react/src/hooks/useFetch.native.ts +++ b/packages/react/src/hooks/useFetch.native.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import { DenormalizeNullable, ExpiryStatus, NI } from '@data-client/core'; import { EndpointInterface, diff --git a/packages/react/src/hooks/useFetch.ts b/packages/react/src/hooks/useFetch.ts index 12bcba21c293..ae9639dad642 100644 --- a/packages/react/src/hooks/useFetch.ts +++ b/packages/react/src/hooks/useFetch.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import { DenormalizeNullable, ExpiryStatus, NI } from '@data-client/core'; import { EndpointInterface, diff --git a/packages/react/src/hooks/useLive.ts b/packages/react/src/hooks/useLive.ts index dbd97d2603e7..4f66c02c55c2 100644 --- a/packages/react/src/hooks/useLive.ts +++ b/packages/react/src/hooks/useLive.ts @@ -1,5 +1,5 @@ 'use client'; -/* eslint-disable @typescript-eslint/ban-ts-comment */ + import { EndpointInterface, Denormalize, diff --git a/packages/react/src/hooks/useQuery.ts b/packages/react/src/hooks/useQuery.ts index 2fbcdecd293e..ad48e23d31f7 100644 --- a/packages/react/src/hooks/useQuery.ts +++ b/packages/react/src/hooks/useQuery.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import type { DenormalizeNullable, NI, diff --git a/packages/react/src/hooks/useSubscription.native.tsx b/packages/react/src/hooks/useSubscription.native.tsx index 800cf6ab0c31..5a47a264c2fe 100644 --- a/packages/react/src/hooks/useSubscription.native.tsx +++ b/packages/react/src/hooks/useSubscription.native.tsx @@ -33,8 +33,6 @@ export default function useSubscription< return () => { controller.unsubscribe(endpoint, ...cleanedArgs); }; - - // eslint-disable-next-line react-hooks/exhaustive-deps }, [controller, key], true, diff --git a/packages/react/src/hooks/useSuspense.native.ts b/packages/react/src/hooks/useSuspense.native.ts index b4f2da155f05..c71e12652752 100644 --- a/packages/react/src/hooks/useSuspense.native.ts +++ b/packages/react/src/hooks/useSuspense.native.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import { ExpiryStatus } from '@data-client/core'; import type { EndpointInterface, diff --git a/packages/react/src/hooks/useSuspense.ts b/packages/react/src/hooks/useSuspense.ts index ef3475553eac..434853e63dee 100644 --- a/packages/react/src/hooks/useSuspense.ts +++ b/packages/react/src/hooks/useSuspense.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import { ExpiryStatus } from '@data-client/core'; import type { EndpointInterface, diff --git a/packages/react/src/hooks/useUniversal.ts b/packages/react/src/hooks/useUniversal.ts index 42f6657f28f8..d0467c1a6b73 100644 --- a/packages/react/src/hooks/useUniversal.ts +++ b/packages/react/src/hooks/useUniversal.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import React, { useContext } from 'react'; const useUniversal: (context: React.Context) => T = diff --git a/packages/react/src/managers/__tests__/RIC.web.ts b/packages/react/src/managers/__tests__/RIC.web.ts index b35ddf3e4541..1758a077317a 100644 --- a/packages/react/src/managers/__tests__/RIC.web.ts +++ b/packages/react/src/managers/__tests__/RIC.web.ts @@ -3,7 +3,7 @@ describe('RequestIdleCallback', () => { const requestIdle = (global as any).requestIdleCallback; (global as any).requestIdleCallback = undefined; jest.resetModules(); - // eslint-disable-next-line @typescript-eslint/no-var-requires + const { IdlingNetworkManager } = await import('..'); const fn = jest.fn(); jest.useFakeTimers(); @@ -17,7 +17,7 @@ describe('RequestIdleCallback', () => { it('should run through requestIdleCallback', async () => { jest.resetModules(); - // eslint-disable-next-line @typescript-eslint/no-var-requires + const { IdlingNetworkManager } = await import('..'); const fn = jest.fn(); jest.useFakeTimers(); diff --git a/packages/react/src/server/nextjs/DataProvider/createPersistedStoreServer.tsx b/packages/react/src/server/nextjs/DataProvider/createPersistedStoreServer.tsx index da2774860659..15c4e9e31757 100644 --- a/packages/react/src/server/nextjs/DataProvider/createPersistedStoreServer.tsx +++ b/packages/react/src/server/nextjs/DataProvider/createPersistedStoreServer.tsx @@ -42,7 +42,7 @@ export default function createPersistedStore(managers?: Manager[]) { const initPromise: Promise> = (async () => { let firstRender = true; - // eslint-disable-next-line no-constant-condition + while (true) { const inFlightFetches = networkManager.allSettled(); if (inFlightFetches) { diff --git a/packages/rest/src/__tests__/RestEndpoint.ts b/packages/rest/src/__tests__/RestEndpoint.ts index 17baae05355e..e0c5a89bb784 100644 --- a/packages/rest/src/__tests__/RestEndpoint.ts +++ b/packages/rest/src/__tests__/RestEndpoint.ts @@ -1369,7 +1369,6 @@ describe('RestEndpoint.fetch()', () => { expect(error).toBeDefined(); expect(error.status).toBe(500); - // eslint-disable-next-line require-atomic-updates console.error = oldError; }); diff --git a/packages/ssr/src/nextjs/DataProvider/createPersistedStoreServer.tsx b/packages/ssr/src/nextjs/DataProvider/createPersistedStoreServer.tsx index d5b9b86c6f18..99f3d67dbb9c 100644 --- a/packages/ssr/src/nextjs/DataProvider/createPersistedStoreServer.tsx +++ b/packages/ssr/src/nextjs/DataProvider/createPersistedStoreServer.tsx @@ -39,7 +39,7 @@ export default function createPersistedStore(managers?: Manager[]) { const initPromise: Promise> = (async () => { let firstRender = true; - // eslint-disable-next-line no-constant-condition + while (true) { const inFlightFetches = networkManager.allSettled(); if (inFlightFetches) {