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
Conversation
LGTM |
Nice. |
"if (baz) foobar();\n" + | ||
"else qux();", | ||
options: [2], | ||
errors: expectedErrors([[2, 0, 2, "IfStatement"], [3, 0, 2, "Keyword"]]) |
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.
Could you add some tests for when the if/else expression has braces as well?
LGTM, except for one suggestion to add some additional tests. |
4c56f0c
to
b409ca9
Compare
LGTM |
Added a few more tests. |
LGTM. @vitorbal What do you think of the new tests? |
Thanks, @not-an-aardvark! LGTM as well. |
LGTM. Thanks for contributing, @not-an-aardvark |
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 inelse if
chains to ensure that all nodes have the right indentation.Is there anything you'd like reviewers to focus on?
Nothing in particular.