Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
TkDodo authored Jul 18, 2024
2 parents 55a3c64 + f1c4ce7 commit d0f0d44
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/react/algolia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"react-dom": "19.0.0-rc-4c2e457c7c-20240522"
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.51.9",
"@tanstack/eslint-plugin-query": "^5.51.10",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"@vitejs/plugin-react": "^4.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"react-dom": "19.0.0-rc-4c2e457c7c-20240522"
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.51.9",
"@tanstack/eslint-plugin-query": "^5.51.10",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"@vitejs/plugin-react": "^4.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"solid-js": "^1.8.17"
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.51.9",
"@tanstack/eslint-plugin-query": "^5.51.10",
"typescript": "5.3.3",
"vite": "^5.3.3",
"vite-plugin-solid": "^2.10.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-query/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tanstack/eslint-plugin-query",
"version": "5.51.9",
"version": "5.51.10",
"description": "ESLint plugin for TanStack Query",
"author": "Eliya Cohen",
"license": "MIT",
Expand Down
14 changes: 10 additions & 4 deletions packages/eslint-plugin-query/src/utils/ast-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,16 @@ export const ASTUtils = {
}) {
const { node, context } = params

const resolvedNode = context
.getScope()
.references.find((ref) => ref.identifier === node)?.resolved?.defs[0]
?.node
// we need the fallbacks for backwards compat with eslint < 8.37.0
// eslint-disable-next-line ts/no-unnecessary-condition
const sourceCode = context.sourceCode ?? context.getSourceCode()
// eslint-disable-next-line ts/no-unnecessary-condition
const scope = context.sourceCode.getScope(node)
? sourceCode.getScope(node)
: context.getScope()

const resolvedNode = scope.references.find((ref) => ref.identifier === node)
?.resolved?.defs[0]?.node

if (resolvedNode?.type !== AST_NODE_TYPES.VariableDeclarator) {
return null
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d0f0d44

Please sign in to comment.