Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint-plugin-query: skipToken breaks exhaustive queryKeys rule #7666

Closed
happycollision opened this issue Jul 3, 2024 · 3 comments · Fixed by #7747
Closed

eslint-plugin-query: skipToken breaks exhaustive queryKeys rule #7666

happycollision opened this issue Jul 3, 2024 · 3 comments · Fixed by #7747
Labels

Comments

@happycollision
Copy link
Contributor

Describe the bug

Just like reported in a related issue, using the skip token prevents the exhaustive queryKeys rule from working. The linked issue is slightly different and deals with closures, etc. Here, I am interested in the potentially simpler problem of making the linter support skipToken properly.

Your minimal, reproducible example

https://eslint-online-playground.netlify.app/#eNq1VMtu2zAQ/JUFTw7gWHcVaXsofOmpD6CHMgeWWtmyKZJdkkEMQ/+eJaU4NuIkSIJcZFs7OzszS3ovAukKb1XvDS42QdSi672jCHsI287/dlu0c0gBfySkHQzQkutBiq9R2RCV3laESsfL/7ksBUgrbZusjp2zue1nMrhUnQmzC9hLC6Ad90EiA1dMs47Rh7o6KNCulyLDCGOiwlAGz0ovQFUB3npkersCBS0zJ0JYI+EIKDq+466Gv1KQc1GK6/lRaWlrYClXn6HFqNczFnKRywM/h7Pq/zjafoT6kLTGEJ7XztGTeaWBUwu/eItvWcAIa9wyT2Foq0woOj9yM/fjvjyyCPXDeXx6X9nsW/b1LrPvWORr/Yq5wGA6G1m6bbvVyY3dhMPlHEHVJkjxSdqpXqY+vr8j9tKbtOrs/T3OwbLD3NZgq5KJbIVlsPFNmIaHBSEn2KNtsGFnJZuRJtQc/9GMibUun0NJgfhqMay8OUe4KAA2XdBT7lPT9CsH6WJ+wTEjkaOcsxSNS/8MPhyvkSI/rzkNztCzJrXK/3fOcn6FToq489xU87feNTyIycZCgzff0GdVVnesiTGTghdzzGxGscZ8BA49R+s5Cxjrp8VigeMQwx2bxPBa

Steps to reproduce

  1. go to the link above
  2. observe that there is only one eslint error when there ought to be 2
    CleanShot 2024-07-03 at 12 44 23@2x

Expected behavior

I expected that there would be two failures instead of one. (The second being when we are missing keys in the skipToken versions)

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • Everything

Tanstack Query adapter

None

TanStack Query version

eslint plugin: 5.50.0 (at time of this writing. It is always latest in the repro url)

TypeScript version

No response

Additional context

No response

@TkDodo TkDodo added bug Something isn't working package: eslint-plugin-query labels Jul 17, 2024
@TkDodo
Copy link
Collaborator

TkDodo commented Jul 17, 2024

@Newbie012 can you maybe look at this issue?

@Newbie012
Copy link
Collaborator

I'll look into it

@Newbie012
Copy link
Collaborator

fixed by #7747

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants