Add option for groups to `sort-keys`
See original GitHub issueWhat rule do you want to change?
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.)?
New option to allow groups separated by blank lines. This concept is taken from the TSLint counterpart, where this is the default behaviour. This will be very helpful for everyone who is migrating from TSLint and used this rule.
Please provide some example code that this change will affect:
const foo = {
a: "Value",
b: "Bar",
action: () => {
console.log()
}
}
What does the rule currently do for this code?
action
should be before b
.
What will the rule do after it’s changed?
Reset the sorting after each blank line, which makes the code valid.
Are you willing to submit a pull request to implement this change?
I might look into it, but I can’t promise anything since I do not have prior experience with writing lint rules.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:5 (3 by maintainers)
Top GitHub Comments
Thanks for clarifying. I’m 👍 for adding this to the core rule. I don’t think it should have to be implemented by
@typescript-eslint/plugin
since the changes proposed aren’t related to TypeScript syntax.Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.
Thanks for contributing to ESLint and we appreciate your understanding.