Skip to content

Commit

Permalink
fix(react-query): eslint-plugin-query now working with vanilla js (#8322
Browse files Browse the repository at this point in the history
)

* fix: eslint-plugin-query not working with vanilla js

* Update packages/eslint-plugin-query/src/utils/detect-react-query-imports.ts

* Disabled linter for conditional statement

This should make it pass the eslint-plugin test

---------

Co-authored-by: Dominik Dorfmeister <[email protected]>
Co-authored-by: Lachlan Collins <[email protected]>
  • Loading branch information
3 people authored Jan 4, 2025
1 parent d08d115 commit f6757a6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export function detectTanstackQueryImports(create: EnhancedCreate): Create {
ImportDeclaration(node) {
if (
node.specifiers.length > 0 &&
node.importKind === 'value' &&
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
(node.importKind === 'value' || node.importKind === undefined) &&
node.source.value.startsWith('@tanstack/') &&
node.source.value.endsWith('-query')
) {
Expand Down

0 comments on commit f6757a6

Please sign in to comment.