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: ignore unmergable imports when checking no-duplicate-imports (fixes #13180) #13180
Conversation
Sorry, looks like we missed this PR! @mdjermanovic you reopened the issue related to this PR, can you take a look? |
👍 |
* Fix: typo in docs/rules/no-duplicate-imports.md
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.
Thanks for the PR! I left some notes.
In this PR we should also check how the new logic affects exports, fix #12760, and account for the new export * as ns
syntax.
I'll try to make an overview on what should and what shouldn't be reported by this rule.
function isTwoNodesCanMerge(node1, node2) { | ||
return ( | ||
( | ||
checkImportType(node1, "ImportNamespaceSpecifier") && | ||
checkImportType(node2, "ImportSpecifier") | ||
) || | ||
( | ||
checkImportType(node1, "ImportSpecifier") && | ||
checkImportType(node2, "ImportNamespaceSpecifier") | ||
) | ||
); | ||
} |
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.
Looks like this function is actually doing the opposite of its name: checks if two nodes cannot be merged?
@cmal there are a couple of changes requested. Can you please take a look? |
OK, sorry for late. I'll have a look. |
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
Closing due to inactivity. New PR: #14238 |
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
…slint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
eslint#13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes eslint#12760)
…) (#14238) * Fix: ignore unmergable imports when checking no-duplicate-imports (fixes #13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes #12760) * Fix: ignore unmergable imports when checking no-duplicate-imports (fixes #13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes #12760) * Fix: ignore unmergable imports when checking no-duplicate-imports (fixes #13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes #12760) * Fix: ignore unmergable imports when checking no-duplicate-imports (fixes #13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes #12760) * Fix: ignore unmergable imports when checking no-duplicate-imports (fixes #13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes #12760) * Fix: ignore unmergable imports when checking no-duplicate-imports (fixes #13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes #12760) * Fix: ignore unmergable imports when checking no-duplicate-imports (fixes #13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes #12760) * Fix: ignore unmergable imports when checking no-duplicate-imports (fixes #13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes #12760) * Fix: ignore unmergable imports when checking no-duplicate-imports (fixes #13180) & Fix: Ignore re-export all in no-duplicate-imports (fixes #12760)
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[X] Documentation update
[X] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
Fix the issue here: #12758
Is there anything you'd like reviewers to focus on?
checkAndReport
function, is that true?