Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/preact-query-devtools/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
Expand Down
2 changes: 0 additions & 2 deletions packages/preact-query-persist-client/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
Expand Down
2 changes: 0 additions & 2 deletions packages/preact-query/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class ErrorBoundary extends Component<
return { didCatch: true, error }
}

resetErrorBoundary(...args: any[]) {
resetErrorBoundary(...args: Array<any>) {
const { error } = this.state

if (error !== null) {
Expand Down Expand Up @@ -126,7 +126,7 @@ export class ErrorBoundary extends Component<
}
}

function hasArrayChanged(a: any[] = [], b: any[] = []) {
function hasArrayChanged(a: Array<any> = [], b: Array<any> = []) {
return (
a.length !== b.length || a.some((item, index) => !Object.is(item, b[index]))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createContext } from 'preact'
type ErrorBoundaryContextType = {
didCatch: boolean
error: any
resetErrorBoundary: (...args: any[]) => void
resetErrorBoundary: (...args: Array<any>) => void
}

export const ErrorBoundaryContext =
Expand Down
12 changes: 8 additions & 4 deletions packages/preact-query/src/__tests__/ErrorBoundary/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {

export type FallbackProps = {
error: any
resetErrorBoundary: (...args: any[]) => void
resetErrorBoundary: (...args: Array<any>) => void
}

type PropsWithChildren<TProps = {}> = TProps & {
Expand All @@ -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<any> }
| {
reason: 'keys'
prev: Array<any> | undefined
next: Array<any> | undefined
},
) => void
resetKeys?: any[]
resetKeys?: Array<any>
}>

type ErrorBoundaryPropsWithComponent = ErrorBoundarySharedProps & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1153,9 +1153,7 @@ describe('useSuspenseQuery', () => {
function Page() {
return (
<div>
<button
onClick={() => queryClient.setQueryData(key, undefined as any)}
>
<button onClick={() => queryClient.setQueryData(key, undefined)}>
set undefined
</button>
<Suspense fallback="loading">
Expand Down
Loading