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

Fix: false negative of indent with else if statements (fixes #6956) #6965

Merged
merged 1 commit into from Aug 25, 2016

Conversation

not-an-aardvark
Copy link
Member

What issue does this pull request address?
#6956

What changes did you make? (Give an overview)

Previously, only the first else statement in a chain would be checked for correct indentation. This PR fixes the issue by recursively checking nodes in else if chains to ensure that all nodes have the right indentation.

Is there anything you'd like reviewers to focus on?

Nothing in particular.

@eslintbot
Copy link

LGTM

@gyandeeps
Copy link
Member

Nice.
LGTM, waiting for others to review.

"if (baz) foobar();\n" +
"else qux();",
options: [2],
errors: expectedErrors([[2, 0, 2, "IfStatement"], [3, 0, 2, "Keyword"]])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some tests for when the if/else expression has braces as well?

@vitorbal
Copy link
Member

LGTM, except for one suggestion to add some additional tests.

@eslintbot
Copy link

LGTM

@not-an-aardvark
Copy link
Member Author

Added a few more tests.

@platinumazure
Copy link
Member

LGTM. @vitorbal What do you think of the new tests?

@vitorbal
Copy link
Member

Thanks, @not-an-aardvark! LGTM as well.

@ilyavolodin
Copy link
Member

LGTM. Thanks for contributing, @not-an-aardvark

@ilyavolodin ilyavolodin merged commit 3e522be into eslint:master Aug 25, 2016
@not-an-aardvark not-an-aardvark deleted the issue6956 branch August 25, 2016 13:22
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 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 6, 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

7 participants