Skip to content

Commit 35b8f89

Browse files
committed
chore: lint violations
1 parent 7f638c7 commit 35b8f89

13 files changed

Lines changed: 15 additions & 39 deletions

File tree

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
import { tanstackConfig } from '@tanstack/config/eslint'
22
import pluginQuery from '@tanstack/eslint-plugin-query'
33
import pluginReact from '@eslint-react/eslint-plugin'
4-
import * as reactHooks from 'eslint-plugin-react-hooks'
54

65
export default [
76
...tanstackConfig,
87
...pluginQuery.configs['flat/recommended'],
98
pluginReact.configs.recommended,
10-
reactHooks.configs.recommended,
11-
{
12-
rules: {
13-
'react-hooks/exhaustive-deps': 'error',
14-
'react-hooks/rules-of-hooks': 'error',
15-
},
16-
},
179
]
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
import { tanstackConfig } from '@tanstack/config/eslint'
22
import pluginQuery from '@tanstack/eslint-plugin-query'
33
import pluginReact from '@eslint-react/eslint-plugin'
4-
import * as reactHooks from 'eslint-plugin-react-hooks'
54

65
export default [
76
...tanstackConfig,
87
...pluginQuery.configs['flat/recommended'],
98
pluginReact.configs.recommended,
10-
reactHooks.configs.recommended,
11-
{
12-
rules: {
13-
'react-hooks/exhaustive-deps': 'error',
14-
'react-hooks/rules-of-hooks': 'error',
15-
},
16-
},
179
]
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
import { tanstackConfig } from '@tanstack/config/eslint'
22
import pluginQuery from '@tanstack/eslint-plugin-query'
33
import pluginReact from '@eslint-react/eslint-plugin'
4-
import * as reactHooks from 'eslint-plugin-react-hooks'
54

65
export default [
76
...tanstackConfig,
87
...pluginQuery.configs['flat/recommended'],
98
pluginReact.configs.recommended,
10-
reactHooks.configs.recommended,
11-
{
12-
rules: {
13-
'react-hooks/exhaustive-deps': 'error',
14-
'react-hooks/rules-of-hooks': 'error',
15-
},
16-
},
179
]
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
import { tanstackConfig } from '@tanstack/config/eslint'
22
import pluginQuery from '@tanstack/eslint-plugin-query'
33
import pluginReact from '@eslint-react/eslint-plugin'
4-
import * as reactHooks from 'eslint-plugin-react-hooks'
54

65
export default [
76
...tanstackConfig,
87
...pluginQuery.configs['flat/recommended'],
98
pluginReact.configs.recommended,
10-
reactHooks.configs.recommended,
11-
{
12-
rules: {
13-
'react-hooks/exhaustive-deps': 'error',
14-
'react-hooks/rules-of-hooks': 'error',
15-
},
16-
},
179
]

packages/react-query-next-experimental/src/HydrationStreamProvider.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export function createHydrationStreamProvider<TShape>() {
130130
.join(',')
131131

132132
// Flush stream
133-
// eslint-disable-next-line react-hooks/react-compiler
133+
// eslint-disable-next-line react-hooks/immutability
134134
stream.length = 0
135135

136136
const html: Array<string> = [
@@ -169,6 +169,7 @@ export function createHydrationStreamProvider<TShape>() {
169169

170170
onEntries(...winStream)
171171

172+
// eslint-disable-next-line react-hooks/immutability
172173
win[id] = {
173174
initialized: true,
174175
push: onEntries,

packages/react-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ describe('PersistQueryClientProvider', () => {
371371
const state = useQuery({
372372
queryKey: key,
373373
queryFn: async () => {
374-
// eslint-disable-next-line react-hooks/react-compiler
375374
fetched = true
376375
await sleep(10)
377376
return 'fetched'

packages/react-query/src/HydrationBoundary.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export const HydrationBoundary = ({
3131
const client = useQueryClient(queryClient)
3232

3333
const optionsRef = React.useRef(options)
34-
optionsRef.current = options
34+
React.useEffect(() => {
35+
optionsRef.current = options
36+
})
3537

3638
// This useMemo is for performance reasons only, everything inside it must
3739
// be safe to run in every render and code here should be read as "in render".
@@ -89,6 +91,7 @@ export const HydrationBoundary = ({
8991
if (newQueries.length > 0) {
9092
// It's actually fine to call this with queries/state that already exists
9193
// in the cache, or is older. hydrate() is idempotent for queries.
94+
// eslint-disable-next-line react-hooks/refs
9295
hydrate(client, { queries: newQueries }, optionsRef.current)
9396
}
9497
if (existingQueries.length > 0) {

packages/react-query/src/__tests__/useQuery.test.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4684,6 +4684,7 @@ describe('useQuery', () => {
46844684

46854685
function Page(props: { limit: number }) {
46864686
const state = useQuery({ queryKey: [key, props.limit], queryFn })
4687+
// eslint-disable-next-line react-hooks/immutability
46874688
states[props.limit] = state
46884689
return (
46894690
<div>
@@ -6152,7 +6153,6 @@ describe('useQuery', () => {
61526153
const key = queryKey()
61536154

61546155
function Page() {
6155-
const mounted = React.useRef<boolean>(false)
61566156
const { data, status } = useQuery({
61576157
enabled: false,
61586158
queryKey: key,
@@ -6162,9 +6162,10 @@ describe('useQuery', () => {
61626162
},
61636163
})
61646164

6165+
const mounted = React.useRef<boolean>(null)
61656166
// this simulates a synchronous update between the time the query is created
61666167
// and the time it is subscribed to that could be missed otherwise
6167-
if (!mounted.current) {
6168+
if (mounted.current === null) {
61686169
mounted.current = true
61696170
queryClient.setQueryData(key, 1)
61706171
}

packages/react-query/src/__tests__/useSuspenseInfiniteQuery.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ describe('useSuspenseInfiniteQuery', () => {
2525
initialPageParam: 1,
2626
getNextPageParam: () => 1,
2727
// @ts-expect-error
28+
// eslint-disable-next-line react-hooks/purity
2829
queryFn: Math.random() >= 0 ? skipToken : () => Promise.resolve(5),
2930
})
3031

packages/react-query/src/__tests__/useSuspenseQueries.test-d.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ describe('UseSuspenseQueries config object overload', () => {
236236
)
237237
})
238238

239-
it('should not show type error when using spreaded queryOptions', () => {
239+
it('should not show type error when using rest queryOptions', () => {
240240
assertType(
241241
useSuspenseQueries({
242242
queries: [

0 commit comments

Comments
 (0)