Closed natesilva closed 6 years ago
I think this syntax is a little unusual, and it's usually blocked by ESLint's import/no-duplicates
rule.
Since splitting into one member per line is not a problem, may I suggest you to use tools like EditorConfig and Prettier to handle format? These ones, specially Prettier, can enforce a code style in terms of legibility, and eliminate the need to actively care about it.
We’re using TSLint, and we don’t have the no-duplicate-imports
rule enabled. We have a database module from which we might import a dozen or more things. Either we have very long lines, or, with Prettier, we get this yuckiness:
import {
functionA,
functionB,
functionC,
functionD,
functionE,
functionF,
functionG,
functionH
} from 'somewhere';
I’ll check out the settings in EditorConfig and Prettier to see if it can be improved.
In my opinion having two imports for the same module is confusing, giving the idea that the imports are coming from different modules.
The multiline import is a standard solution for this situations.
Anyway I'll leave this open for discussion.
Closed due to lack of discussion :)
If I have:
Can I break that into separate lines when sorting, maybe based on line length?