Add sort-imports member sorting into a separate option
See original GitHub issueWhat rule do you want to change?
sort-imports
Does this change cause the rule to produce more or fewer warnings?
Fewer
How will the change be implemented? (New option, new default behavior, etc.)?
Currently, sort-imports
does two checks. One is always on, the other is optional. I would like to only use the optional part.
One part is that it checks the order of import statements. This can’t be turned off. I would like to check this using import/order, which offers more advanced features.
The part of the rule I would like to use, is the sorting of the imported members.
My proposal is to split the distinct memberSort
option into a separate rule: sort-import-members
.
Please provide some example code that this change will affect:
// Builtins
import { join, resolve } from 'path';
// External
import { map } from 'lodash';
What does the rule currently do for this code?
sort-imports
will cause conflicts with import/order
, but also make sure import members are sorted nicely.
What will the rule do after it’s changed?
sort-imports
should be disabled to prevent conflicts with import/order
.
sort-import-members
will ensure the imported members are sorted, as sort-imports
does now.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:11 (10 by maintainers)
Top GitHub Comments
@remcohaszing thanks for the ping. Sorry, a lot of team members are taking time off around this time of year, so things can take a bit longer than usual. It looks like enough team members support this change so I’m marking as accepted. The next step is to review the PR.
Is any action required from me? I thought not, but it’s taking much longer to get merged than I expected.