Skip to content

Commit d227630

Browse files
authored
Merge branch 'main' into feature/defaultQueryFnTypes
2 parents 50f0d59 + 3cc0c15 commit d227630

File tree

8 files changed

+32
-10
lines changed

8 files changed

+32
-10
lines changed

examples/react/algolia/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"react-dom": "^18.2.0"
1919
},
2020
"devDependencies": {
21-
"@tanstack/eslint-plugin-query": "^5.28.6",
21+
"@tanstack/eslint-plugin-query": "^5.28.11",
2222
"@types/react": "^18.2.55",
2323
"@types/react-dom": "^18.2.19",
2424
"@vitejs/plugin-react": "^4.2.1",

examples/react/basic-typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"react-dom": "^18.2.0"
1919
},
2020
"devDependencies": {
21-
"@tanstack/eslint-plugin-query": "^5.28.6",
21+
"@tanstack/eslint-plugin-query": "^5.28.11",
2222
"@types/react": "^18.2.55",
2323
"@types/react-dom": "^18.2.19",
2424
"@vitejs/plugin-react": "^4.2.1",

examples/react/basic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"react-dom": "^18.2.0"
1616
},
1717
"devDependencies": {
18-
"@tanstack/eslint-plugin-query": "^5.28.6",
18+
"@tanstack/eslint-plugin-query": "^5.28.11",
1919
"@vitejs/plugin-react": "^4.2.1",
2020
"vite": "^5.1.1"
2121
},

examples/solid/simple/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"solid-js": "^1.8.14"
1515
},
1616
"devDependencies": {
17-
"@tanstack/eslint-plugin-query": "^5.28.6",
17+
"@tanstack/eslint-plugin-query": "^5.28.11",
1818
"typescript": "5.2.2",
1919
"vite": "^5.1.1",
2020
"vite-plugin-solid": "^2.9.1"

packages/eslint-plugin-query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tanstack/eslint-plugin-query",
3-
"version": "5.28.6",
3+
"version": "5.28.11",
44
"description": "ESLint plugin for TanStack Query",
55
"author": "Eliya Cohen",
66
"license": "MIT",

packages/eslint-plugin-query/src/__tests__/exhaustive-deps.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,5 +726,24 @@ ruleTester.run('exhaustive-deps', rule, {
726726
},
727727
],
728728
},
729+
{
730+
name: 'should fail if queryFn is invalid while using FunctionExpression syntax',
731+
code: normalizeIndent`
732+
const id = 1;
733+
734+
useQuery({
735+
queryKey: [],
736+
queryFn() {
737+
Promise.resolve(id)
738+
}
739+
})
740+
`,
741+
errors: [
742+
{
743+
messageId: 'missingDeps',
744+
data: { deps: 'id' },
745+
},
746+
],
747+
},
729748
],
730749
})

packages/eslint-plugin-query/src/rules/exhaustive-deps/exhaustive-deps.rule.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ export const rule = createRule({
5555
scopeManager === null ||
5656
queryKey === undefined ||
5757
queryFn === undefined ||
58-
queryFn.value.type !== AST_NODE_TYPES.ArrowFunctionExpression
58+
!ASTUtils.isNodeOfOneOf(queryFn.value, [
59+
AST_NODE_TYPES.ArrowFunctionExpression,
60+
AST_NODE_TYPES.FunctionExpression,
61+
])
5962
) {
6063
return
6164
}

pnpm-lock.yaml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)