Skip to content

chore: add typescript-eslint/require-await rule #9029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4d7cd20
chore: add typescript-eslint/require-await rule
minseong0324 Apr 15, 2025
8d1b2d8
Merge branch 'main' into chore/ts-async-lint-rules
TkDodo Apr 17, 2025
5e47f22
Merge branch 'main' into chore/ts-async-lint-rules
minseong0324 Apr 17, 2025
9dd5dec
reflect feedback
minseong0324 Apr 17, 2025
9ad919a
Merge branch 'main' into chore/ts-async-lint-rules
minseong0324 Apr 18, 2025
cf0cb22
Merge branch 'main' into chore/ts-async-lint-rules
TkDodo Apr 19, 2025
9efe120
Update eslint.config.js
TkDodo Apr 19, 2025
4e8332f
Merge branch 'main' into chore/ts-async-lint-rules
TkDodo Apr 19, 2025
003754d
Merge branch 'main' into chore/ts-async-lint-rules
minseong0324 Apr 23, 2025
c80f93d
Merge branch 'main' into chore/ts-async-lint-rules
minseong0324 Apr 25, 2025
904bb53
Merge branch 'main' into chore/ts-async-lint-rules
minseong0324 Apr 26, 2025
31982b9
Merge branch 'main' into chore/ts-async-lint-rules
minseong0324 May 1, 2025
c8caf80
Merge branch 'main' into chore/ts-async-lint-rules
minseong0324 May 1, 2025
3f08775
Merge branch 'main' into chore/ts-async-lint-rules
minseong0324 May 1, 2025
fce23ab
Merge branch 'main' into chore/ts-async-lint-rules
minseong0324 May 3, 2025
7234b15
Merge branch 'main' into chore/ts-async-lint-rules
TkDodo May 4, 2025
f30c39f
Merge branch 'main' into chore/ts-async-lint-rules
minseong0324 May 4, 2025
4a2a2b0
Merge branch 'main' into chore/ts-async-lint-rules
TkDodo May 4, 2025
9c51366
test(angular-query-experimental): remove unnecessary async
minseong0324 May 4, 2025
bf4a823
test(*): remove unnecessary async
minseong0324 May 4, 2025
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
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ 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',
})
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',
Expand Down
2 changes: 1 addition & 1 deletion packages/query-core/src/__tests__/queryObserver.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<unknown>) => string>()
Expand Down
2 changes: 1 addition & 1 deletion packages/react-query/src/__tests__/useQuery.test-d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe('useQuery', () => {
)
expectTypeOf(testFuncStyle.data).toEqualTypeOf<boolean | undefined>()

it('should return the correct states for a successful query', async () => {
it('should return the correct states for a successful query', () => {
const state = useQuery<string, Error>({
queryKey: key,
queryFn: () => Promise.resolve('test'),
Expand Down
4 changes: 2 additions & 2 deletions packages/react-query/src/__tests__/useQuery.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,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<UseQueryResult<string>> = []

Expand Down Expand Up @@ -1084,7 +1084,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<UseQueryResult<number>> = []
let count = 0
Expand Down
Loading