Skip to content

Commit bd3296b

Browse files
chore: Update @tanstack/config to v0.11.0 (#7795)
1 parent 1814f56 commit bd3296b

File tree

19 files changed

+203
-52
lines changed

19 files changed

+203
-52
lines changed

Diff for: eslint.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ export default [
3535
},
3636
},
3737
],
38-
'ts/ban-types': 'off',
39-
'ts/no-empty-function': 'off',
38+
'@typescript-eslint/ban-types': 'off',
39+
'@typescript-eslint/no-empty-function': 'off',
4040
'no-case-declarations': 'off',
4141
},
4242
},

Diff for: examples/react/offline/public/mockServiceWorker.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint-disable */
2-
/* tslint:disable */
32

43
/**
54
* Mock Service Worker (2.1.7).

Diff for: examples/solid/solid-start-streaming/src/components/query-boundary.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
2-
31
import type { CreateQueryResult } from '@tanstack/solid-query'
42
import type { JSX } from 'solid-js'
53
import { ErrorBoundary, Match, Suspense, Switch, children } from 'solid-js'

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@cspell/eslint-plugin": "^8.9.1",
4242
"@eslint-react/eslint-plugin": "^1.5.16",
4343
"@solidjs/testing-library": "^0.8.8",
44-
"@tanstack/config": "^0.10.0",
44+
"@tanstack/config": "^0.11.0",
4545
"@testing-library/jest-dom": "^6.4.6",
4646
"@testing-library/react": "^16.0.0",
4747
"@types/eslint": "^8.56.10",

Diff for: packages/angular-query-experimental/src/util/create-injection-token/create-injection-token.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export function createNoopInjectionToken<
169169
type TReturn = TMulti extends true ? Array<TValue> : TValue
170170

171171
const token =
172-
// eslint-disable-next-line ts/no-unnecessary-condition
172+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
173173
(options as CreateInjectionTokenOptions<() => void, []>)?.token ||
174174
new InjectionToken<TReturn>(description)
175175
return [

Diff for: packages/eslint-plugin-query/src/utils/ast-utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ export const ASTUtils = {
249249
const { node, context } = params
250250

251251
// we need the fallbacks for backwards compat with eslint < 8.37.0
252-
// eslint-disable-next-line ts/no-unnecessary-condition
252+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
253253
const sourceCode = context.sourceCode ?? context.getSourceCode()
254-
// eslint-disable-next-line ts/no-unnecessary-condition
254+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
255255
const scope = context.sourceCode.getScope(node)
256256
? sourceCode.getScope(node)
257257
: context.getScope()

Diff for: packages/query-codemods/eslint.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default [
77
{
88
rules: {
99
'cspell/spellchecker': 'off',
10-
'ts/no-unnecessary-condition': 'off',
10+
'@typescript-eslint/no-unnecessary-condition': 'off',
1111
'import/no-duplicates': 'off',
1212
'import/no-unresolved': 'off',
1313
'import/order': 'off',

Diff for: packages/query-core/src/__tests__/notifyManager.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ describe('notifyManager', () => {
7474
// we define some fn with its signature:
7575
const fn: (a: string, b: number) => string = (a, b) => a + b
7676

77-
//now someFn expect to be called with args [a: string, b: number]
77+
// now someFn expect to be called with args [a: string, b: number]
7878
const someFn = notifyManagerTest.batchCalls(fn)
7979

8080
someFn('im happy', 4)
8181

82-
//@ts-expect-error
82+
// @ts-expect-error
8383
someFn('im not happy', false)
8484
})
8585
})

Diff for: packages/query-core/src/__tests__/onlineManager.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('onlineManager', () => {
1212
const navigatorSpy = vi.spyOn(globalThis, 'navigator', 'get')
1313

1414
// Force navigator to be undefined
15-
//@ts-expect-error
15+
// @ts-expect-error
1616
navigatorSpy.mockImplementation(() => undefined)
1717
expect(onlineManager.isOnline()).toBeTruthy()
1818

Diff for: packages/query-core/src/__tests__/queryObserver.test.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ describe('queryObserver', () => {
9696

9797
queryClient.invalidateQueries({ queryKey: key, refetchType: 'all' })
9898

99-
//So we still expect it to not have fetched and not be fetching
99+
// So we still expect it to not have fetched and not be fetching
100100
expect(count).toBe(0)
101101
expect(observer.getCurrentResult()).toMatchObject({
102102
status: 'pending',
@@ -113,7 +113,7 @@ describe('queryObserver', () => {
113113

114114
expect(enabled).toBe(false)
115115

116-
//Not the same with explicit refetch, this will override enabled and trigger a fetch anyway
116+
// Not the same with explicit refetch, this will override enabled and trigger a fetch anyway
117117
observer.refetch()
118118

119119
expect(observer.getCurrentResult()).toMatchObject({
@@ -201,18 +201,18 @@ describe('queryObserver', () => {
201201

202202
queryClient.invalidateQueries({ queryKey: key, refetchType: 'inactive' })
203203

204-
//should not refetch since it was active and we only refetch inactive
204+
// should not refetch since it was active and we only refetch inactive
205205
await waitFor(() => expect(count).toBe(0))
206206

207207
queryClient.invalidateQueries({ queryKey: key, refetchType: 'active' })
208208

209-
//should refetch since it was active and we refetch active
209+
// should refetch since it was active and we refetch active
210210
await waitFor(() => expect(count).toBe(1))
211211

212212
// Toggle enabled
213213
enabled = false
214214

215-
//should not refetch since it is not active and we only refetch active
215+
// should not refetch since it is not active and we only refetch active
216216
queryClient.invalidateQueries({ queryKey: key, refetchType: 'active' })
217217

218218
await waitFor(() => expect(count).toBe(1))
@@ -792,7 +792,7 @@ describe('queryObserver', () => {
792792
new QueryObserver(queryClient, {
793793
queryKey: key,
794794
queryFn: () => 'data',
795-
//@ts-expect-error
795+
// @ts-expect-error
796796
enabled: null,
797797
}),
798798
).toThrowError('Expected enabled to be a boolean')
@@ -947,7 +947,7 @@ describe('queryObserver', () => {
947947
observer.setOptions({
948948
queryKey: key,
949949
queryFn: () => data,
950-
//@ts-expect-error
950+
// @ts-expect-error
951951
select: () => undefined,
952952
placeholderData: placeholderData2,
953953
})

Diff for: packages/query-core/src/focusManager.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class FocusManager extends Subscribable<Listener> {
1717
super()
1818
this.#setup = (onFocus) => {
1919
// addEventListener does not exist in React Native, but window does
20-
// eslint-disable-next-line ts/no-unnecessary-condition
20+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
2121
if (!isServer && window.addEventListener) {
2222
const listener = () => onFocus()
2323
// Listen to visibilitychange
@@ -78,7 +78,7 @@ export class FocusManager extends Subscribable<Listener> {
7878
}
7979

8080
// document global can be unavailable in react native
81-
// eslint-disable-next-line ts/no-unnecessary-condition
81+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
8282
return globalThis.document?.visibilityState !== 'hidden'
8383
}
8484
}

Diff for: packages/query-core/src/hydration.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ export function hydrate(
154154
client.getDefaultOptions().hydrate?.deserializeData ??
155155
defaultTransformerFn
156156

157-
// eslint-disable-next-line ts/no-unnecessary-condition
157+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
158158
const mutations = (dehydratedState as DehydratedState).mutations || []
159-
// eslint-disable-next-line ts/no-unnecessary-condition
159+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
160160
const queries = (dehydratedState as DehydratedState).queries || []
161161

162162
mutations.forEach(({ state, ...mutationOptions }) => {

Diff for: packages/query-core/src/onlineManager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class OnlineManager extends Subscribable<Listener> {
1414
super()
1515
this.#setup = (onOnline) => {
1616
// addEventListener does not exist in React Native, but window does
17-
// eslint-disable-next-line ts/no-unnecessary-condition
17+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1818
if (!isServer && window.addEventListener) {
1919
const onlineListener = () => onOnline(true)
2020
const offlineListener = () => onOnline(false)

Diff for: packages/react-query/eslint.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default [
2828
{
2929
files: ['**/__tests__/**'],
3030
rules: {
31-
'ts/no-unnecessary-condition': 'off',
31+
'@typescript-eslint/no-unnecessary-condition': 'off',
3232
'react-compiler/react-compiler': 'off',
3333
},
3434
},

Diff for: packages/react-query/src/HydrationBoundary.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const HydrationBoundary = ({
5858
}
5959

6060
const queryCache = client.getQueryCache()
61-
// eslint-disable-next-line ts/no-unnecessary-condition
61+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
6262
const queries = (state as DehydratedState).queries || []
6363

6464
const newQueries: DehydratedState['queries'] = []

Diff for: packages/react-query/src/__tests__/useQuery.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4034,7 +4034,7 @@ describe('useQuery', () => {
40344034
const query = useQuery({
40354035
queryKey: key,
40364036
queryFn: () => 'fetched data',
4037-
gcTime: 1000 * 60 * 10, //10 Minutes
4037+
gcTime: 1000 * 60 * 10, // 10 Minutes
40384038
})
40394039
return <div>{query.data}</div>
40404040
}
@@ -4216,7 +4216,7 @@ describe('useQuery', () => {
42164216

42174217
await waitFor(() => rendered.getByText('count: 1'))
42184218

4219-
await sleep(10) //extra sleep to make sure we're not re-fetching
4219+
await sleep(10) // extra sleep to make sure we're not re-fetching
42204220

42214221
expect(states.length).toEqual(2)
42224222

Diff for: packages/solid-query/src/__tests__/createQuery.test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -3842,7 +3842,7 @@ describe('createQuery', () => {
38423842
const query = createQuery(() => ({
38433843
queryKey: key,
38443844
queryFn: () => 'fetched data',
3845-
gcTime: 1000 * 60 * 10, //10 Minutes
3845+
gcTime: 1000 * 60 * 10, // 10 Minutes
38463846
}))
38473847
return <div>{query.data}</div>
38483848
}
@@ -4047,7 +4047,7 @@ describe('createQuery', () => {
40474047

40484048
await waitFor(() => rendered.getByText('count: 1'))
40494049

4050-
await sleep(10) //extra sleep to make sure we're not re-fetching
4050+
await sleep(10) // extra sleep to make sure we're not re-fetching
40514051

40524052
expect(states.length).toEqual(2)
40534053

@@ -4560,7 +4560,7 @@ describe('createQuery', () => {
45604560
readonly [typeof key, number]
45614561
> = async (ctx) => {
45624562
const [, limit] = ctx.queryKey
4563-
// eslint-disable-next-line ts/no-unnecessary-condition
4563+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
45644564
const value = limit % 2 && ctx.signal ? 'abort' : `data ${limit}`
45654565
await sleep(25)
45664566
return value

Diff for: packages/vue-query/src/useBaseQuery.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export function useBaseQuery<
145145
return new Promise<QueryObserverResult<TData, TError>>(
146146
(resolve, reject) => {
147147
let stopWatch = () => {
148-
//noop
148+
// noop
149149
}
150150
const run = () => {
151151
if (defaultedOptions.value.enabled !== false) {

0 commit comments

Comments
 (0)