fix(eslint-plugin): [no-restricted-imports] disallow side effect imports when allowTypeImports is enabled#7560
fix(eslint-plugin): [no-restricted-imports] disallow side effect imports when allowTypeImports is enabled#7560bradzacher merged 3 commits intotypescript-eslint:mainfrom joshkel:restricted-side-effect-imports
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. |
bradzacher
left a comment
There was a problem hiding this comment.
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."
✨