-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Added id-length rule to eslintrc #505
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
Conversation
|
please add the id-length documentation URL to your PR as a comment, following the style of the rest of the eslintrc. |
|
Done! |
Added id-length rule to eslintrc
|
@amsardesai What variable do you recommend using for "for loops"? |
|
@toxicFork I generally try to avoid using for loops if I could use for (var index = 0; index < someLength; index++) {
...
}What do you think? |
|
For the "for loop"... I've always use "ctr". These loops involves counter. ctr for short. Simple enough for me. |
|
What are people's opinions on adding an exception for |
|
@justjake @hshoff @gausie, I also got bitten by it. There are other valid uses:
|
|
Also anything to do with geometry and math, e.g. THREE.Vector3.{x, y, z} and many others. It will remain disabled in all my configs. |
|
@toxicFork Yeah, true. Generally I’m no fan of one-letter variables – but how else can you name |
|
Turns out no one likes this rule. Will turn it back off eventually |
|
👍 👍 |
|
Thanks! |
This helps make sure variable names are longer than 1 character.
Single letter variable names are almost guaranteed to be completely non descriptive, this makes sure our variable names are longer than that.
Documentation on the id-length rule: http://eslint.org/docs/rules/id-length.html