Skip to content
Source
Sign inSign up
TanStack/query

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

Send to my agent
Closedhappycollision(GitHub profile, opens in a new tab) opened this issue 3 comments

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

  1. TkDodo added labelsbug

  2. TkDodo added labelspackage: eslint-plugin-query

  3. @Newbie012 can you maybe look at this issue?

Sign in to join this conversation.