-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix(react-query): eslint-plugin-query now working with vanilla js #8322
Conversation
packages/eslint-plugin-query/src/utils/detect-react-query-imports.ts
Outdated
Show resolved
Hide resolved
View your CI Pipeline Execution ↗ for commit 36ea4f4.
☁️ Nx Cloud last updated this comment at |
there’s a lint error because typescript thinks the check is unnecessary:
you must likely disable the linter for this line |
This should make it pass the eslint-plugin test
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8322 +/- ##
===========================================
+ Coverage 46.26% 88.22% +41.95%
===========================================
Files 199 15 -184
Lines 7532 501 -7031
Branches 1720 186 -1534
===========================================
- Hits 3485 442 -3043
+ Misses 3668 45 -3623
+ Partials 379 14 -365
|
Hey, just here to bring attention back to this PR I want to ask if there's any reason why it hasn't been merged yet? |
To fix the issue with detecting imports in both TypeScript and JavaScript files, I modify the
ImportDeclaration
handler to handle cases whereimportKind
might be undefined.The key change is adding
node.importKind === undefined
to the condition. This ensures the import detection works for both TypeScript (whereimportKind
is explicitly 'value') and JavaScript (whereimportKind
is undefined).This modification should resolve the lint plugin's compatibility issue with vanilla JavaScript apps by allowing import detection regardless of the
importKind
value.closes #8257