Skip to content
Source
Sign inSign up
TanStack/query

fix(eslint-plugin-query): Exhaustive deps rule not working for vue files #10011

Mergedgk9848970(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/10011/headmerged by TkDodo View on GitHub

Showing 4 changed files with 115 additions and 0 deletions (loading 1).

x
0 of 4 viewed, 4 left
5 additions and 0 deletions.changeset/slimy-taxes-make.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/eslint-plugin-query': patch
+---
+​
+exhaustive-deps rule fixed for vue files
109 additions and 0 deletionspackages/eslint-plugin-query/src/__tests__/exhaustive-deps.test.tsModified
View file
@@ -548,6 +548,45 @@
+ {
+ name: 'should pass in Vue file when deps are correctly included (script setup)',
+ filename: 'Component.vue',
+ code: normalizeIndent`
+ import { useQuery } from '@tanstack/vue-query'
+​
+ const id = 1
+ useQuery({
+ queryKey: ['entity', id],
+ queryFn: () => fetchEntity(id),
+ })
+ `,
+ },