-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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,benchmark,lib,test: enable no-case-declarations lint rule #41385
Conversation
Review requested:
|
This comment has been minimized.
This comment has been minimized.
Do you know if there is (or should be) a predefined rule that enforces that either all or no cases belonging to a |
I'm unaware of anything like that in ESLint core. There might be a third-party module available, and it shouldn't be too hard to write one ourselves. (I'd be -0 on doing that because it's extra maintenance for IMO little benefit. But if you or someone else feels strongly about it, I wouldn't try to persuade you to not do it.) |
This comment has been minimized.
This comment has been minimized.
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.
LGTM, not sure how I feel about the additional inconsistencies between case
s (aesthetically).
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.
+1. Also agree with the eventual goal of eslint recommended and happy to see work to get us closer to that :)
Commit Queue failed- Loading data for nodejs/node/pull/41385 ✔ Done loading data for nodejs/node/pull/41385 ----------------------------------- PR info ------------------------------------ Title tools,benchmark,lib,test: enable no-case-declarations lint rule (#41385) Author Rich Trott (@Trott) Branch Trott:no-case-declaration -> nodejs:master Labels Commits 1 - tools,benchmark,lib,test: enable no-case-declarations lint rule Committers 1 - Rich Trott PR-URL: https://github.com/nodejs/node/pull/41385 Reviewed-By: Michaël Zasso Reviewed-By: Antoine du Hamel Reviewed-By: Tobias Nießen Reviewed-By: Tierney Cyren Reviewed-By: Ricky Zhou <0x19951125@gmail.com> Reviewed-By: Colin Ihrig ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/41385 Reviewed-By: Michaël Zasso Reviewed-By: Antoine du Hamel Reviewed-By: Tobias Nießen Reviewed-By: Tierney Cyren Reviewed-By: Ricky Zhou <0x19951125@gmail.com> Reviewed-By: Colin Ihrig -------------------------------------------------------------------------------- ℹ This PR was created on Mon, 03 Jan 2022 04:26:25 GMT ✔ Approvals: 6 ✔ - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/41385#pullrequestreview-842509110 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/41385#pullrequestreview-842568613 ✔ - Tobias Nießen (@tniessen) (TSC): https://github.com/nodejs/node/pull/41385#pullrequestreview-842952082 ✔ - Tierney Cyren (@bnb): https://github.com/nodejs/node/pull/41385#pullrequestreview-842990323 ✔ - Ricky Zhou (@rickyes): https://github.com/nodejs/node/pull/41385#pullrequestreview-843192744 ✔ - Colin Ihrig (@cjihrig) (TSC): https://github.com/nodejs/node/pull/41385#pullrequestreview-843588295 ✖ GitHub CI is still running ℹ Last Full PR CI on 2022-01-05T14:09:03Z: https://ci.nodejs.org/job/node-test-pull-request/41763/ - Querying data for job/node-test-pull-request/41763/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/1659016743 |
PR-URL: nodejs#41385 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Ricky Zhou <0x19951125@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2115a8e
to
55ceaec
Compare
Landed in 55ceaec |
PR-URL: #41385 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Ricky Zhou <0x19951125@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #41385 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Ricky Zhou <0x19951125@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#41385 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Ricky Zhou <0x19951125@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #41385 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Ricky Zhou <0x19951125@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Don't leak identifiers into other
case
declarations. This is an ESLint recommended rule. My goal/hope is to be able to enableeslint:recommended
at some point and have far fewer individual rules specified in.eslintrc.js
.