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: fix indentation of EmptyStatements (fixes #8882) #8885
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The `indent` rule contains some logic to ensure that semicolons at the start of a line are indented correctly when using semicolon-free style. For example, in the following code the semicolon on the second line is not indented, even though it's part of the `bar()` statement. ```js if (foo) bar() ; [1, 2, 3].map(foo) ``` Due to a bug, this logic also applied to semicolons in `EmptyStatement` nodes, resulting in an incorrect indentation for those semicolons. This commit fixes that bug.
not-an-aardvark
added
accepted
There is consensus among the team that this change meets the criteria for inclusion
bug
ESLint is working incorrectly
indent
Relates to the `indent` rule
rule
Relates to ESLint's core rules
labels
Jul 6, 2017
LGTM |
platinumazure
approved these changes
Jul 6, 2017
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.
LGTM, thanks!
gyandeeps
approved these changes
Jul 8, 2017
This was referenced Jul 9, 2017
Trott
added a commit
to Trott/io.js
that referenced
this pull request
Jul 10, 2017
ESLint 4.2.0 contains a fix for a bug that is blocking us from moving to the non-legacy stricter indentation linting. Update to 4.2.0 to remove the blocking issue. Refs: eslint/eslint#8882 Refs: eslint/eslint#8885
2 tasks
Trott
added a commit
to Trott/io.js
that referenced
this pull request
Jul 12, 2017
ESLint 4.2.0 contains a fix for a bug that is blocking us from moving to the non-legacy stricter indentation linting. Update to 4.2.0 to remove the blocking issue. PR-URL: nodejs#14155 Ref: eslint/eslint#8882 Ref: eslint/eslint#8885 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
addaleax
pushed a commit
to nodejs/node
that referenced
this pull request
Jul 18, 2017
ESLint 4.2.0 contains a fix for a bug that is blocking us from moving to the non-legacy stricter indentation linting. Update to 4.2.0 to remove the blocking issue. PR-URL: #14155 Ref: eslint/eslint#8882 Ref: eslint/eslint#8885 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Fishrock123
pushed a commit
to nodejs/node
that referenced
this pull request
Jul 19, 2017
ESLint 4.2.0 contains a fix for a bug that is blocking us from moving to the non-legacy stricter indentation linting. Update to 4.2.0 to remove the blocking issue. PR-URL: #14155 Ref: eslint/eslint#8882 Ref: eslint/eslint#8885 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
MylesBorins
pushed a commit
to nodejs/node
that referenced
this pull request
Aug 16, 2017
ESLint 4.2.0 contains a fix for a bug that is blocking us from moving to the non-legacy stricter indentation linting. Update to 4.2.0 to remove the blocking issue. PR-URL: #14155 Ref: eslint/eslint#8882 Ref: eslint/eslint#8885 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Trott
added a commit
to Trott/io.js
that referenced
this pull request
Aug 16, 2017
ESLint 4.2.0 contains a fix for a bug that is blocking us from moving to the non-legacy stricter indentation linting. Update to 4.2.0 to remove the blocking issue. PR-URL: nodejs#14155 Ref: eslint/eslint#8882 Ref: eslint/eslint#8885 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
MylesBorins
pushed a commit
to nodejs/node
that referenced
this pull request
Aug 16, 2017
ESLint 4.2.0 contains a fix for a bug that is blocking us from moving to the non-legacy stricter indentation linting. Update to 4.2.0 to remove the blocking issue. Backport-PR-URL: #14859 PR-URL: #14155 Ref: eslint/eslint#8882 Ref: eslint/eslint#8885 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
MylesBorins
pushed a commit
to nodejs/node
that referenced
this pull request
Sep 5, 2017
ESLint 4.2.0 contains a fix for a bug that is blocking us from moving to the non-legacy stricter indentation linting. Update to 4.2.0 to remove the blocking issue. Backport-PR-URL: #14859 PR-URL: #14155 Ref: eslint/eslint#8882 Ref: eslint/eslint#8885 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
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
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
bug
ESLint is working incorrectly
indent
Relates to the `indent` rule
rule
Relates to ESLint's core rules
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request? (put an "X" next to item)
[x] Bug fix (#8882)
What changes did you make? (Give an overview)
The
indent
rule contains some logic to ensure that semicolons at the start of a line are indented correctly when using semicolon-free style. For example, in the following code the semicolon on the second line is not indented, even though it's part of thebar()
statement.Due to a bug, this logic also applied to semicolons in
EmptyStatement
nodes, resulting in an incorrect indentation for those semicolons. This commit fixes that bug.Is there anything you'd like reviewers to focus on?
Nothing in particular