-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix: allow separate default and named type imports #19899
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: allow separate default and named type imports #19899
Conversation
✅ Deploy Preview for docs-eslint canceled.
|
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.
LGTM. Thanks. Holding off on merging until we decide on a patch release.
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.
Should this case be considered valid as well?
{
code: `
import type A from "module";
export type { B } from "module";
`,
options: [{ includeExports: true }],
},
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.
Yes I believe this should be valid.
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.
LGTM, thanks!
We are going to release this fix with ESLint v9.30.1. |
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
This PR fixes a false positive in no-duplicate-imports rule where it incorrectly flagged separate default and named TypeScript type imports as duplicates. Since TypeScript syntax prohibits combining these into a single import statement, the rule should allow them to coexist without warnings.
What changes did you make? (Give an overview)
Fixes #19898
Is there anything you'd like reviewers to focus on?