Describe the bug
When using the following config for exhaustive-deps:
"@tanstack/query/exhaustive-deps": ["error", {"allowlist": {"variables": ["ignored"]} }]
This code produces an error:
export const incorrect = () => {
const ignored = {
run: () => new Promise()
}
useQuery({
queryKey: ["test"],
queryFn: () => ignored
.run() // 💥
});
};
However, if we change the formatting, the error disappears:
export const correct = () => {
const ignored = {
run: () => new Promise()
}
useQuery({
queryKey: ["test"],
queryFn: () => ignored.run() // ✅
});
};
Your minimal, reproducible example
https://github.com/antoine-cottineau/tanstack-query-eslint-plugin-bug/tree/main
Steps to reproduce
- run
yarn install
- run
yarn lint
An error is found in the incorrect function but not in the correct one, even if the only difference is formatting.
Expected behavior
No error should be reported, whatever the formatting.
How often does this bug happen?
Every time
Screenshots or Videos
Platform
- OS: MacOS
- Browser: Brave
- Version: 1.88.134
Tanstack Query adapter
react-query
TanStack Query version
v5.95.2
TypeScript version
No response
Additional context
No response
Describe the bug
When using the following config for
exhaustive-deps:This code produces an error:
However, if we change the formatting, the error disappears:
Your minimal, reproducible example
https://github.com/antoine-cottineau/tanstack-query-eslint-plugin-bug/tree/main
Steps to reproduce
yarn installyarn lintAn error is found in the
incorrectfunction but not in thecorrectone, even if the only difference is formatting.Expected behavior
No error should be reported, whatever the formatting.
How often does this bug happen?
Every time
Screenshots or Videos
Platform
Tanstack Query adapter
react-query
TanStack Query version
v5.95.2
TypeScript version
No response
Additional context
No response