diff --git a/eslint.config.js b/eslint.config.js index f156cd2e9c..3b5cd36f26 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -39,6 +39,7 @@ export default [ ], '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-unsafe-function-type': 'off', + '@typescript-eslint/require-await': 'error', 'no-case-declarations': 'off', }, }, diff --git a/packages/angular-query-experimental/src/__tests__/inject-infinite-query.test-d.ts b/packages/angular-query-experimental/src/__tests__/inject-infinite-query.test-d.ts index f07e0ded24..93bda3204e 100644 --- a/packages/angular-query-experimental/src/__tests__/inject-infinite-query.test-d.ts +++ b/packages/angular-query-experimental/src/__tests__/inject-infinite-query.test-d.ts @@ -23,7 +23,7 @@ describe('injectInfiniteQuery', () => { vi.useRealTimers() }) - test('should narrow type after isSuccess', async () => { + test('should narrow type after isSuccess', () => { const query = TestBed.runInInjectionContext(() => { return injectInfiniteQuery(() => ({ queryKey: ['infiniteQuery'], diff --git a/packages/query-broadcast-client-experimental/src/__tests__/index.test.ts b/packages/query-broadcast-client-experimental/src/__tests__/index.test.ts index 763a7edd58..6e09d8a86e 100644 --- a/packages/query-broadcast-client-experimental/src/__tests__/index.test.ts +++ b/packages/query-broadcast-client-experimental/src/__tests__/index.test.ts @@ -12,7 +12,7 @@ describe('broadcastQueryClient', () => { queryCache = queryClient.getQueryCache() }) - it('should subscribe to the query cache', async () => { + it('should subscribe to the query cache', () => { broadcastQueryClient({ queryClient, broadcastChannel: 'test_channel', @@ -20,7 +20,7 @@ describe('broadcastQueryClient', () => { expect(queryCache.hasListeners()).toBe(true) }) - it('should not have any listeners after cleanup', async () => { + it('should not have any listeners after cleanup', () => { const unsubscribe = broadcastQueryClient({ queryClient, broadcastChannel: 'test_channel', diff --git a/packages/query-codemods/eslint.config.js b/packages/query-codemods/eslint.config.js index 19a16c3c1e..aa13b1cd93 100644 --- a/packages/query-codemods/eslint.config.js +++ b/packages/query-codemods/eslint.config.js @@ -1,6 +1,5 @@ // @ts-check -import vitest from '@vitest/eslint-plugin' import rootConfig from './root.eslint.config.js' export default [ @@ -9,6 +8,7 @@ export default [ rules: { 'cspell/spellchecker': 'off', '@typescript-eslint/no-unnecessary-condition': 'off', + '@typescript-eslint/require-await': 'off', 'import/no-duplicates': 'off', 'import/no-unresolved': 'off', 'import/order': 'off', diff --git a/packages/query-core/src/__tests__/queryObserver.test.tsx b/packages/query-core/src/__tests__/queryObserver.test.tsx index 6b8b70ace9..6d20eb2430 100644 --- a/packages/query-core/src/__tests__/queryObserver.test.tsx +++ b/packages/query-core/src/__tests__/queryObserver.test.tsx @@ -31,7 +31,7 @@ describe('queryObserver', () => { vi.useRealTimers() }) - test('should trigger a fetch when subscribed', async () => { + test('should trigger a fetch when subscribed', () => { const key = queryKey() const queryFn = vi .fn<(...args: Array) => string>() diff --git a/packages/react-query/src/__tests__/useQuery.test-d.tsx b/packages/react-query/src/__tests__/useQuery.test-d.tsx index fd5e265b74..7e99666beb 100644 --- a/packages/react-query/src/__tests__/useQuery.test-d.tsx +++ b/packages/react-query/src/__tests__/useQuery.test-d.tsx @@ -152,7 +152,7 @@ describe('useQuery', () => { ) expectTypeOf(testFuncStyle.data).toEqualTypeOf() - it('should return the correct states for a successful query', async () => { + it('should return the correct states for a successful query', () => { const state = useQuery({ queryKey: key, queryFn: () => Promise.resolve('test'), diff --git a/packages/react-query/src/__tests__/useQuery.test.tsx b/packages/react-query/src/__tests__/useQuery.test.tsx index 3635b668bf..02bd28d929 100644 --- a/packages/react-query/src/__tests__/useQuery.test.tsx +++ b/packages/react-query/src/__tests__/useQuery.test.tsx @@ -608,7 +608,7 @@ describe('useQuery', () => { expect(states[1]).toMatchObject({ data: 'test' }) }) - it('should not fetch when refetchOnMount is false and data has been fetched already', async () => { + it('should not fetch when refetchOnMount is false and data has been fetched already', () => { const key = queryKey() const states: Array> = [] @@ -1106,7 +1106,7 @@ describe('useQuery', () => { }) }) - it('should not refetch disabled query when invalidated with invalidateQueries', async () => { + it('should not refetch disabled query when invalidated with invalidateQueries', () => { const key = queryKey() const states: Array> = [] let count = 0