0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
Commit graph

34 commits

Author SHA1 Message Date
Wonsuk Choi
56432b4a22
docs: use 'sh' instead of 'bash' for the shell code blocks (#12207) 2026-10-20 17:21:27 +09:00
Wonsuk Choi
eddeaa1fc9
docs(eslint/exhaustive-deps): mark the rule as providing suggestions instead of being fixable (#12043) 2026-10-17 18:03:14 +02:00
Wonsuk Choi
cc185b0807
docs(eslint/no-void-query-fn): note that the rule requires typed linting (#12042) 2026-10-17 02:40:13 +09:00
Wonsuk Choi
fceed3463c
docs(eslint/eslint-plugin-query): add an 'Oxlint' section for using the plugin through 'jsPlugins' (#12041) 2026-10-17 02:39:57 +09:00
Ciarán Curley
40321a0b1b
docs: add docs for simplified query methods (#10662)
docs: add docs for simplfied impertive query methods

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-08-22 21:04:36 +02:00
Eliya Cohen
7ac45ed45c
fix(eslint-plugin-query): ignore call targets in exhaustive-deps (#11067)
* fix(query-eslint): ignore call targets in exhaustive deps

* fix(query-eslint): guard AST parent access

* fix(query-eslint): accept JSX scope references

---------

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-07-21 14:50:23 +02:00
Eliya Cohen
dc54932864
fix(eslint-plugin-query): detect rest destructuring on custom query hooks (#10775)
* fix(eslint-plugin-query): detect rest destructuring on custom query hooks

Adds an opportunistic type-aware path to no-rest-destructuring. When
TypeScript parser services are available, the rule resolves the call
expression's return type and reports rest destructuring on custom hooks
that return a TanStack Query result. Untyped projects keep the existing
AST-only behavior unchanged.

Closes #8951

* perf(eslint-plugin-query): gate type lookup behind cheap binding check

Only run the type checker on non-direct hook calls when the binding can
actually report (rest destructure or identifier), avoiding type lookups on
every variable declarator. Add tests for cross-statement rest destructuring
and interface-typed (non-alias) query results.

* ci: apply automated fixes

---------

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-02 14:29:10 +02:00
Aleksei Kharitonov
61b97638e3
docs(eslint/no-unstable-deps): correct 'react' package name casing in examples (#10553)
fix(docs): correct import casing in no-unstable-deps examples
2026-04-23 20:08:15 +09:00
Eliya Cohen
ed2f2ab01f
feat(eslint-plugin-query): add prefer-query-options rule (#10359) 2026-03-31 13:12:57 +03:00
Eliya Cohen
3443736e29
feat(eslint-plugin): add allowlist option to exhaustive-deps rule (#10295)
* feat(eslint-plugin): add allowlist option to exhaustive-deps rule

Introduce an `allowlist` option with `variables` and `types` arrays so
stable variables and types can be excluded from dependency enforcement.

Also report member expression dependencies more granularly for call
expressions (e.g. `a.b.foo()` suggests `a.b` instead of only `a`).

BREAKING CHANGE: exhaustive-deps now reports member expression deps more
granularly, so some previously passing code may now report missing deps.
Use the allowlist option to exclude stable variables/types as needed.

* fix

* ci: apply automated fixes

* increase coverage

* address false positives

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-03-22 18:33:16 +01:00
Lachlan Collins
5ad78fc4ad
docs: correct local relative links (#9947)
* docs: correct local relative links

* Update links

* Slight tweaks

* String
2025-12-05 22:39:25 +11:00
espada-edalex
593eacbf17
docs: add docs for mutation-property-order eslint rule (#9271) 2025-09-29 17:11:46 +02:00
Tanner Linsley
afc6302dbf docs: fix links
commit 113eb6ba963534fe80b3e96193d767bf769c8bff
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Fri May 23 23:16:11 2025 -0600

    docs: fix: only transform generated reference

commit d1d084ed9026e31ba746e1bb87d5c19183a7d148
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Fri May 23 23:12:07 2025 -0600

    docs: fix broken links

commit 0df59ea7d8afb16be86ae917fc46900b6e999351
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Fri May 23 15:54:19 2025 -0600

    fix: rewrite type doc links to be directory-relative

commit 81e4c71f1c9250005f164b7e585837ee0ad14e23
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Fri May 23 15:14:51 2025 -0600

    fix: initial fix for ./ => ../
2025-05-24 00:47:55 -06:00
Eliya Cohen
993e838d5f
feat(eslint-plugin): no-void-queryFn (#8925)
* feat(eslint-plugin-query): implement no-void-query-fn rule

* add docs

* ci: apply automated fixes

* build(eslint-plugin-query): switch from vite to tsup for building

* update lockfile

* revert lockfile

* fix

* fix publint

* chore: add script to patch missing export equals

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-04-07 11:17:45 +02:00
Dominik Dorfmeister
cea2d58733
Revert "feat(eslint-plugin): no void queryFn (#8878)" (#8880)
This reverts commit c2e5272346.
2025-03-30 14:48:40 +02:00
Eliya Cohen
c2e5272346
feat(eslint-plugin): no void queryFn (#8878)
* feat(eslint-plugin-query): implement no-void-query-fn rule

* add docs

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-03-30 10:49:49 +02:00
TkDodo
f03b1090d9 docs: fix eslint links 2025-03-18 10:11:00 +01:00
Maria José Solano
b975d89d93
docs: update links to ESLint rules (#8758) 2025-03-07 13:45:47 +11:00
Ethan Glover
aa6d3f84df
docs: Add @tanstack/query/infinite-query-property-order link (#8285) 2024-11-13 08:03:51 +01:00
Gaurav Kumar
55a6155cdf
docs(react-query): Fix broken route on eslint-plugin-query.md (#8113) 2024-10-01 13:10:08 +02:00
Lachlan Collins
ade6283944
fix(eslint-plugin): fix legacy recommended config (#8104) 2024-09-27 17:56:50 +10:00
thilllon
a9e83a4678
docs: missing code format (#8102) 2024-09-26 19:04:33 +02:00
Peter Bengtsson
1104948728
docs: Don't use $ prefix in Bash examples (#8067)
On https://tanstack.com/query/latest/docs/framework/react/installation for example, the Bash snippets do *not* have a leading `$` character. So you can click the clipboard and then paste these into your terminal. 
Doesn't work if there's a `$ ` prefix on the bash command.
2024-09-21 11:35:33 +02:00
Manuel Schiller
f8d65fb5de
feat(eslint-plugin-query): add rule to ensure property order of infinite query functions (#8072)
* feat(eslint-plugin-query): add rule to ensure property order of infinite query functions

* remove outdated comment

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-09-20 21:45:40 +02:00
Manuel Schiller
f65ebe70cb
feat(eslint-plugin-query): add rule that disallows putting the result of query hooks directly in a React hook dependency array (#7911)
* feat(eslint-plugin-query): add rule that disallows putting the result of useMutation directly in a React hook dependency array

* add doc

* add rule to recommended rules

* generalize to all affected query hooks

* rename rule to "no-unstable-deps"
2024-08-20 20:51:35 +02:00
Jay
3292791219
docs: divided installation scripts (#7881) 2024-08-19 10:36:40 +02:00
twiddler
8d0ba7ea3a
docs(eslint-plugin-query): Fix rules links (#7705) 2024-07-10 11:59:38 +10:00
Lachlan Collins
98547b6b64
feat(eslint-plugin-query): Add compatibility with flat config (#7663)
* feat(eslint-plugin-query): Add flat config compatibility

* Add flat/recommended

* Fix types

* Use in basic-typescript

* Load plugin with flat/recommended

* Update docs

* Add react and react-hooks back

* Remove test

* Fix attw
2024-07-03 10:18:25 +10:00
Dominik Dorfmeister
55782aebbb chore: fix lint 2024-02-26 08:53:01 +01:00
Ekam Ahuja
d83aa272fb
docs: Updated installation commands with bun package manger (#6971) 2024-02-25 10:15:32 +01:00
Lachlan Collins
c22ca89cf3
docs: Move eslint docs to core (#6779) 2024-01-27 07:53:47 +11:00
Damian Osipiuk
198017b75d
docs: align routing with framework switcher (#4608)
* docs: align routing with framework switcher

Co-authored-by: Aryan Deora <adeora@iu.edu>

* docs: remove angular from docs config

* docs: add doc ref redirect example

Co-authored-by: Aryan Deora <adeora@iu.edu>
2022-12-16 10:25:43 +01:00
Bennett Dams
b421e74ca2
docs(eslint-plugin-query): Prefer dev install (#4489)
This change adds the CLI flags to install the ESLint plugin as a dev dependency instead of a normal dependency.
2022-11-09 11:23:49 +01:00
Eliya Cohen
5d5c0f0f80
feat: eslint-plugin-query
* add @tanstack/eslint-plugin-query

* fix .eslintrc rule name

* make rule compatible with babel parser

* fix script typo

* remove dedicated example in favor of the basic example

* align package version with the other packages

* align eslint-plugin-query version

* fix displayName

* remove typescript from package

* omit call expressions from keys without the need of whitelist

* lint queryKey instead of useQuery

* update pnpm-lock.yaml

* fix auto-fix suggestion for complex ast

* better inline query key

* fix typo

* update scripts

* restore .eslintrc

* update typescript-eslint packages

* support member expression keys

* format

* should not fix with duplicate keys

* format

* empty commit (flaky test)

* should ignore keys from callback

* Update packages/eslint-plugin-query/package.json

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>

* add prefer-query-object-syntax rule

* fix indention

* fix headline

* add rule description

* fix lint errors

* widen import check for all adapters

* add support for solid-query (createQuery)

* docs: add eslint plugin section

* prettier

* move docs

* EsLint -> ESLint

* fix typo

* add missing dep

* update lockfile

* give credit where credit is due

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-11-01 12:00:42 +01:00