ESLint Rule to Disallow Object Rest Destructuring in tanstack-query
#6265
Unanswered
alan910127
asked this question in
Ideas
Replies: 1 comment 1 reply
-
Good idea. I would put the level to warning though. @Newbie012 what do you think? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I'd like to propose an enhancement for
@tanstack/eslint-plugin-query
with an ESLint rule, possibly namedno-rest-destructuring
, which discourages or provides an auto-fix for object rest destructuring on the return value of theuseQuery
,useQueries
anduseInfiniteQuery
hooks.Motivation
As highlighted in TkDodo's Blog, using object rest destructuring tracks all the fields of the query, potentially leading to excessive re-renders. This behavior could impact users of
tanstack-query
.Example
Beta Was this translation helpful? Give feedback.
All reactions