Skip to content
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

Merged
merged 1 commit into from
Oct 21, 2015
Merged

Update: Option to allow afterthoughts in no-plusplus (fixes #4093) #4177

merged 1 commit into from
Oct 21, 2015

Conversation

mrmckeb
Copy link
Contributor

@mrmckeb mrmckeb commented Oct 17, 2015

No description provided.

@platinumazure
Copy link
Member

Afterthoughts? First I've heard of that term in this context.

@mrmckeb
Copy link
Contributor Author

mrmckeb commented Oct 17, 2015

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 afterthought as the final-expression.

@mrmckeb mrmckeb changed the title Update: Option to exclude afterthoughts from no-plusplus (fixes #4093) Update: Option to allow afterthoughts in no-plusplus (fixes #4093) Oct 17, 2015

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`.
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

@mrmckeb
Copy link
Contributor Author

mrmckeb commented Oct 20, 2015

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!

@nzakas
Copy link
Member

nzakas commented Oct 21, 2015

LGTM. Thanks!

nzakas added a commit that referenced this pull request Oct 21, 2015
Update: Option to allow afterthoughts in no-plusplus (fixes #4093)
@nzakas nzakas merged commit d4237a8 into eslint:master Oct 21, 2015
@mrmckeb
Copy link
Contributor Author

mrmckeb commented Oct 21, 2015

Thank you, @nzakas. You've done great work on ESLint.

@mrmckeb mrmckeb deleted the no-plusplus-for-loop-option branch October 21, 2015 23:04
@ericyang89
Copy link

thanks, i meet the same problem

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants