-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Update: Option to allow afterthoughts in no-plusplus (fixes #4093) #4177
Conversation
Afterthoughts? First I've heard of that term in this context. |
Hi @platinumazure, I had to research it a little, see an example of that usage here: https://en.wikipedia.org/wiki/For_loop. Mozilla refers to the |
|
||
This rule, in it's default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows: | ||
|
||
* `forLoopAfterthoughts` set to `true` will allow you to use the unary operators `++` and `--` in the `afterthought` (or `final-expression`) of a `for loop`. |
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.
A little too much code text here. :)
forLoopAfterthoughts
set to true
will allow the use of the unary operators ++
and --
in the afterthought (final expression) of a for
loop.
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.
I think the option probably needs to be named allowForLoopAfterthoughts
to make it clear what it's doing.
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 @nzakas. I'll make those changes shortly.
Hi @nzakas, this is now updated and the build is passing. Let me know if there are any other changes you'd like to see. Thanks again! |
LGTM. Thanks! |
Update: Option to allow afterthoughts in no-plusplus (fixes #4093)
Thank you, @nzakas. You've done great work on ESLint. |
thanks, i meet the same problem |
No description provided.