Order is not enforced between wildcard and non-wildcard imports of the same module
Sometimes, we have a wildcard and non-wildcard import of the same module, e.g.
import * as module1 from 'lib/module1';
import {Module1Helper} from 'lib/module1';
eslint-plugin-simple-import sort allows these imports to be in any order. Is this intentional?
Hi!
I found this comment in the code:
https://github.com/lydell/eslint-plugin-simple-import-sort/blob/0e89217c31384d9487577a72bd6b322808ec6a3b/src/shared.js#L727-L730
So, yeah, it seems intentional. With the thought that there shouldn’t be duplicate imports anyway.
Haven’t thought of the case where you have both a wildcard import and import a few things separately before. At first glance, it does sound like the plugin should provide consistency there, but I also suspect it to be a bit of a rabbit hole figuring out exactly how it should work.
Yeah, the no-duplicates won't help here because you can't combine wildcard and non-wildcard into a single import.
For me, any consistent ordering would be fine, e.g. wildcard first.