-
-
Notifications
You must be signed in to change notification settings - Fork 5k
[no-duplicate-imports] Treat namespace imports as different #12758
Copy link
Copy link
Closed
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyESLint is working incorrectlygood first issueGood for people who haven't worked on ESLint beforeGood for people who haven't worked on ESLint beforehelp wantedThe team would welcome a contribution from the community for this issueThe team would welcome a contribution from the community for this issueruleRelates to ESLint's core rulesRelates to ESLint's core rules
Metadata
Metadata
Assignees
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyESLint is working incorrectlygood first issueGood for people who haven't worked on ESLint beforeGood for people who haven't worked on ESLint beforehelp wantedThe team would welcome a contribution from the community for this issueThe team would welcome a contribution from the community for this issueruleRelates to ESLint's core rulesRelates to ESLint's core rules
Type
Projects
Status
Complete
What rule do you want to change?
no-duplicate-imports
Does this change cause the rule to produce more or fewer warnings?
Reduces warnings.
How will the change be implemented? (New option, new default behavior, etc.)?
Behavioural change, which could be either option controlled or new default behaviour.
Prior art: TSLint.
Please provide some example code that this change will affect:
What does the rule currently do for this code?
Marks the imports as duplicates
What will the rule do after it's changed?
Not mark the imports as duplicates
Are you willing to submit a pull request to implement this change?
Yes
The primary use I have for the above is with mocking in jest, such as here where I want to both use the parsers & also spy on them to test that specific ones are called.
While I can use destructuring, or reference off
parsers, the former won't be understood by auto-importers (i.e TS & IDE), and the latter would be inconsistent to how I use the functions in the rest of the codebase.