-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(eslint-plugin): [no-restricted-imports] disallow side effect imports when allowTypeImports is enabled #7560
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(eslint-plugin): [no-restricted-imports] disallow side effect imports when allowTypeImports is enabled #7560
Conversation
❌ Deploy Preview for typescript-eslint failed.
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #7560 +/- ##
=======================================
Coverage 87.23% 87.23%
=======================================
Files 387 387
Lines 13401 13401
Branches 3962 3962
=======================================
Hits 11690 11690
Misses 1327 1327
Partials 384 384
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Thanks for the PR, @joshkel! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for completeness - could we also get a valid test case for import 'foo'
with no banning config just to sanity-check that it still continues to pass?
otherwise looking good to me! great work!
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
@bradzacher Done (if I've understood correctly). Thanks for the review! |
thanks for fixing this! |
PR Checklist
Overview
Fixes #7559 by changing the logic from #7379 from "allow imports if all specifiers are types (or if no specifiers exist)" to "allow imports if specifiers exist and all specifiers are types."
✨