From f6757a603ae1afe756837b3d8b41728069491fef Mon Sep 17 00:00:00 2001 From: Ifeanyi Aladi <62919243+ShyneADL@users.noreply.github.com> Date: Sat, 4 Jan 2025 12:32:59 +0100 Subject: [PATCH] fix(react-query): eslint-plugin-query now working with vanilla js (#8322) * 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 Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> --- .../src/utils/detect-react-query-imports.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin-query/src/utils/detect-react-query-imports.ts b/packages/eslint-plugin-query/src/utils/detect-react-query-imports.ts index 40795476f5..9b5aebb4e7 100644 --- a/packages/eslint-plugin-query/src/utils/detect-react-query-imports.ts +++ b/packages/eslint-plugin-query/src/utils/detect-react-query-imports.ts @@ -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') ) {