diff --git a/packages/preact-query-devtools/eslint.config.js b/packages/preact-query-devtools/eslint.config.js index 9480817c5d..2f02929555 100644 --- a/packages/preact-query-devtools/eslint.config.js +++ b/packages/preact-query-devtools/eslint.config.js @@ -21,8 +21,6 @@ export default defineConfig([ 'no-import-assign': 'off', // TS-aware version handles overloads correctly '@typescript-eslint/no-redeclare': 'error', - '@typescript-eslint/array-type': 'off', - '@typescript-eslint/no-unnecessary-type-assertion': 'off', '@typescript-eslint/no-unnecessary-condition': 'off', }, }, diff --git a/packages/preact-query-persist-client/eslint.config.js b/packages/preact-query-persist-client/eslint.config.js index 9480817c5d..2f02929555 100644 --- a/packages/preact-query-persist-client/eslint.config.js +++ b/packages/preact-query-persist-client/eslint.config.js @@ -21,8 +21,6 @@ export default defineConfig([ 'no-import-assign': 'off', // TS-aware version handles overloads correctly '@typescript-eslint/no-redeclare': 'error', - '@typescript-eslint/array-type': 'off', - '@typescript-eslint/no-unnecessary-type-assertion': 'off', '@typescript-eslint/no-unnecessary-condition': 'off', }, }, diff --git a/packages/preact-query/eslint.config.js b/packages/preact-query/eslint.config.js index 9480817c5d..2f02929555 100644 --- a/packages/preact-query/eslint.config.js +++ b/packages/preact-query/eslint.config.js @@ -21,8 +21,6 @@ export default defineConfig([ 'no-import-assign': 'off', // TS-aware version handles overloads correctly '@typescript-eslint/no-redeclare': 'error', - '@typescript-eslint/array-type': 'off', - '@typescript-eslint/no-unnecessary-type-assertion': 'off', '@typescript-eslint/no-unnecessary-condition': 'off', }, }, diff --git a/packages/preact-query/src/__tests__/ErrorBoundary/ErrorBoundary.ts b/packages/preact-query/src/__tests__/ErrorBoundary/ErrorBoundary.ts index b363a80b9e..457eb8ae78 100644 --- a/packages/preact-query/src/__tests__/ErrorBoundary/ErrorBoundary.ts +++ b/packages/preact-query/src/__tests__/ErrorBoundary/ErrorBoundary.ts @@ -34,7 +34,7 @@ export class ErrorBoundary extends Component< return { didCatch: true, error } } - resetErrorBoundary(...args: any[]) { + resetErrorBoundary(...args: Array) { const { error } = this.state if (error !== null) { @@ -126,7 +126,7 @@ export class ErrorBoundary extends Component< } } -function hasArrayChanged(a: any[] = [], b: any[] = []) { +function hasArrayChanged(a: Array = [], b: Array = []) { return ( a.length !== b.length || a.some((item, index) => !Object.is(item, b[index])) ) diff --git a/packages/preact-query/src/__tests__/ErrorBoundary/ErrorBoundaryContext.ts b/packages/preact-query/src/__tests__/ErrorBoundary/ErrorBoundaryContext.ts index 5f0315b848..6eb775ecf6 100644 --- a/packages/preact-query/src/__tests__/ErrorBoundary/ErrorBoundaryContext.ts +++ b/packages/preact-query/src/__tests__/ErrorBoundary/ErrorBoundaryContext.ts @@ -3,7 +3,7 @@ import { createContext } from 'preact' type ErrorBoundaryContextType = { didCatch: boolean error: any - resetErrorBoundary: (...args: any[]) => void + resetErrorBoundary: (...args: Array) => void } export const ErrorBoundaryContext = diff --git a/packages/preact-query/src/__tests__/ErrorBoundary/types.ts b/packages/preact-query/src/__tests__/ErrorBoundary/types.ts index 16e29744be..0b241b5ad1 100644 --- a/packages/preact-query/src/__tests__/ErrorBoundary/types.ts +++ b/packages/preact-query/src/__tests__/ErrorBoundary/types.ts @@ -7,7 +7,7 @@ import type { export type FallbackProps = { error: any - resetErrorBoundary: (...args: any[]) => void + resetErrorBoundary: (...args: Array) => void } type PropsWithChildren = TProps & { @@ -18,10 +18,14 @@ type ErrorBoundarySharedProps = PropsWithChildren<{ onError?: (error: Error, info: ErrorInfo) => void onReset?: ( details: - | { reason: 'imperative-api'; args: any[] } - | { reason: 'keys'; prev: any[] | undefined; next: any[] | undefined }, + | { reason: 'imperative-api'; args: Array } + | { + reason: 'keys' + prev: Array | undefined + next: Array | undefined + }, ) => void - resetKeys?: any[] + resetKeys?: Array }> type ErrorBoundaryPropsWithComponent = ErrorBoundarySharedProps & { diff --git a/packages/preact-query/src/__tests__/useSuspenseQuery.test.tsx b/packages/preact-query/src/__tests__/useSuspenseQuery.test.tsx index bc88b3a043..c33bcb97bc 100644 --- a/packages/preact-query/src/__tests__/useSuspenseQuery.test.tsx +++ b/packages/preact-query/src/__tests__/useSuspenseQuery.test.tsx @@ -1153,9 +1153,7 @@ describe('useSuspenseQuery', () => { function Page() { return (
-