Skip to content

Commit 2da46cd

Browse files
authored
chore(*): use eslint description syntax for grandfathered 'no-restricted-syntax' disables (#11508)
1 parent 4324e61 commit 2da46cd

18 files changed

Lines changed: 77 additions & 154 deletions

‎packages/angular-query-experimental/src/__tests__/infinite-query-options.test-d.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ describe('infiniteQueryOptions', () => {
7272
initialPageParam: 1,
7373
})
7474

75-
// grandfathered direct test
76-
// eslint-disable-next-line no-restricted-syntax
75+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
7776
const data = await new QueryClient().fetchInfiniteQuery(options)
7877

7978
expectTypeOf(data).toEqualTypeOf<InfiniteData<string, number>>()

‎packages/angular-query-experimental/src/__tests__/query-options.test-d.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ it('should work when passed to fetchQuery', () => {
7676
queryFn: () => Promise.resolve(5),
7777
})
7878

79-
// grandfathered direct test
80-
// eslint-disable-next-line no-restricted-syntax
79+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
8180
const data = new QueryClient().fetchQuery(options)
8281
assertType<Promise<number>>(data)
8382
})

‎packages/preact-query/src/__tests__/infiniteQueryOptions.test-d.tsx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ describe('infiniteQueryOptions', () => {
131131
initialPageParam: 1,
132132
})
133133

134-
// grandfathered direct test
135-
// eslint-disable-next-line no-restricted-syntax
134+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
136135
const data = await new QueryClient().fetchInfiniteQuery(options)
137136

138137
expectTypeOf(data).toEqualTypeOf<InfiniteData<string, number>>()

‎packages/preact-query/src/__tests__/queryOptions.test-d.tsx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ describe('queryOptions', () => {
109109
queryFn: () => Promise.resolve(5),
110110
})
111111

112-
// grandfathered direct test
113-
// eslint-disable-next-line no-restricted-syntax
112+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
114113
const data = await new QueryClient().fetchQuery(options)
115114
expectTypeOf(data).toEqualTypeOf<number>()
116115
})

‎packages/preact-query/src/__tests__/useInfiniteQuery.test-d.tsx‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ describe('pageParam', () => {
3131

3232
it('initialPageParam should define type of param passed to queryFunctionContext for fetchInfiniteQuery', () => {
3333
const queryClient = new QueryClient()
34-
// grandfathered direct test
35-
// eslint-disable-next-line no-restricted-syntax
34+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
3635
queryClient.fetchInfiniteQuery({
3736
queryKey: queryKey(),
3837
queryFn: ({ pageParam }) => {
@@ -56,8 +55,7 @@ describe('pageParam', () => {
5655

5756
it('initialPageParam should define type of param passed to queryFunctionContext for prefetchInfiniteQuery', () => {
5857
const queryClient = new QueryClient()
59-
// grandfathered direct test
60-
// eslint-disable-next-line no-restricted-syntax
58+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
6159
queryClient.prefetchInfiniteQuery({
6260
queryKey: queryKey(),
6361
queryFn: ({ pageParam }) => {

‎packages/query-core/src/__tests__/queryClient.test-d.tsx‎

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -384,17 +384,15 @@ describe('queryClient', () => {
384384

385385
it('should resolve with the data type', async () => {
386386
const queryClient = new QueryClient()
387-
// grandfathered direct test
388-
// eslint-disable-next-line no-restricted-syntax
387+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
389388
const data = await queryClient.fetchQuery(typedQueryOptions)
390389

391390
expectTypeOf(data).toEqualTypeOf<TypedData>()
392391
})
393392

394393
it('should resolve with unknown when untyped', async () => {
395394
const queryClient = new QueryClient()
396-
// grandfathered direct test
397-
// eslint-disable-next-line no-restricted-syntax
395+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
398396
const data = await queryClient.fetchQuery(untypedQueryOptions)
399397

400398
expectTypeOf(data).toEqualTypeOf<unknown>()
@@ -419,8 +417,7 @@ describe('queryClient', () => {
419417
})
420418

421419
it('should allow passing pages', async () => {
422-
// grandfathered direct test
423-
// eslint-disable-next-line no-restricted-syntax
420+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
424421
const data = await new QueryClient().fetchInfiniteQuery({
425422
queryKey: queryKey(),
426423
queryFn: () => Promise.resolve('string'),
@@ -457,8 +454,7 @@ describe('queryClient', () => {
457454

458455
it('should resolve with InfiniteData of the data type', async () => {
459456
const queryClient = new QueryClient()
460-
// grandfathered direct test
461-
// eslint-disable-next-line no-restricted-syntax
457+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
462458
const data = await queryClient.fetchInfiniteQuery(
463459
typedFetchInfiniteQueryOptions,
464460
)
@@ -468,8 +464,7 @@ describe('queryClient', () => {
468464

469465
it('should resolve with InfiniteData of unknown when untyped', async () => {
470466
const queryClient = new QueryClient()
471-
// grandfathered direct test
472-
// eslint-disable-next-line no-restricted-syntax
467+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
473468
const data = await queryClient.fetchInfiniteQuery(
474469
untypedFetchInfiniteQueryOptions,
475470
)
@@ -528,17 +523,15 @@ describe('queryClient', () => {
528523
describe('ensureQueryData', () => {
529524
it('should resolve with the data type', async () => {
530525
const queryClient = new QueryClient()
531-
// grandfathered direct test
532-
// eslint-disable-next-line no-restricted-syntax
526+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
533527
const data = await queryClient.ensureQueryData(typedQueryOptions)
534528

535529
expectTypeOf(data).toEqualTypeOf<TypedData>()
536530
})
537531

538532
it('should resolve with unknown when untyped', async () => {
539533
const queryClient = new QueryClient()
540-
// grandfathered direct test
541-
// eslint-disable-next-line no-restricted-syntax
534+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
542535
const data = await queryClient.ensureQueryData(untypedQueryOptions)
543536

544537
expectTypeOf(data).toEqualTypeOf<unknown>()
@@ -653,8 +646,7 @@ describe('queryClient', () => {
653646
describe('ensureInfiniteQueryData', () => {
654647
it('should resolve with InfiniteData of the data type', async () => {
655648
const queryClient = new QueryClient()
656-
// grandfathered direct test
657-
// eslint-disable-next-line no-restricted-syntax
649+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
658650
const data = await queryClient.ensureInfiniteQueryData(
659651
typedFetchInfiniteQueryOptions,
660652
)
@@ -664,8 +656,7 @@ describe('queryClient', () => {
664656

665657
it('should resolve with InfiniteData of unknown when untyped', async () => {
666658
const queryClient = new QueryClient()
667-
// grandfathered direct test
668-
// eslint-disable-next-line no-restricted-syntax
659+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
669660
const data = await queryClient.ensureInfiniteQueryData(
670661
untypedFetchInfiniteQueryOptions,
671662
)
@@ -676,8 +667,7 @@ describe('queryClient', () => {
676667
it('should accept a revalidateIfStale that FetchInfiniteQueryOptions does not have', () => {
677668
const queryClient = new QueryClient()
678669

679-
// grandfathered direct test
680-
// eslint-disable-next-line no-restricted-syntax
670+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
681671
queryClient.ensureInfiniteQueryData({
682672
...typedFetchInfiniteQueryOptions,
683673
revalidateIfStale: true,
@@ -949,8 +939,7 @@ describe('queryClient', () => {
949939
describe('prefetchQuery', () => {
950940
it('should return a promise of void rather than the data', () => {
951941
const queryClient = new QueryClient()
952-
// grandfathered direct test
953-
// eslint-disable-next-line no-restricted-syntax
942+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
954943
const result = queryClient.prefetchQuery({
955944
queryKey: ['key'],
956945
queryFn: () => Promise.resolve('string'),
@@ -963,8 +952,7 @@ describe('queryClient', () => {
963952
describe('prefetchInfiniteQuery', () => {
964953
it('should return a promise of void rather than the pages', () => {
965954
const queryClient = new QueryClient()
966-
// grandfathered direct test
967-
// eslint-disable-next-line no-restricted-syntax
955+
// eslint-disable-next-line no-restricted-syntax -- grandfathered direct test
968956
const result = queryClient.prefetchInfiniteQuery({
969957
queryKey: ['key'],
970958
queryFn: () => Promise.resolve('string'),

0 commit comments

Comments
 (0)