-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
tools: add sort-keys rule in eslint #41768
Conversation
Add sort-keys rule in EsLint. Related issue: nodejs#41767 CC:@nodejs/linting
CC: @nodejs/linting |
I agree with the sentiment, the problem being the diff would be way too large for it to be worth it. Ideally we would have another set of "aspirational" lint rules that would apply only on code being added, but I'm not sure it exists a tool that would allow us to do that. |
It might be better to set it as |
Warnings wouldn't help much in our case, it would make ESLint output very noisy, and the auto-fixes would probably still produce that large diff I'd like to avoid. |
Instead, can we go for |
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 this (and all your recent work it's appreciated!)
Blocking so this doesn't land without consensus which we didn't have last time.
Sure. Let's invite opinions. Thanks @benjamingr |
I think it's the same consensus as regarding trailing commas: we'd like to have them used everywhere, but it's not worth accepting PRs focusing on adding them. While improving the consistency of the code base is great, landing commits that do stylistic changes pollute the git blame output, without improving the quality of the codebase otherwise. If you are able to limit the scope to a smaller chunk of the code base that already complies with this rule, sure that would certainly be accepted, but you have to keep in mind that humans review the PRs, so a PR that introduces thousands of changes across the whole codebase is probably too much to ask. |
Even if we had that, I would be -1 on enabling this rule with it. |
Closing the MR for the time being as discussed the unintended issues behind this change. |
Add sort-keys rule in EsLint.
Related issue: #41767
CC: @nodejs/linting