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
curly: multi-or-nest option reports an error for a single-statment block with a semicolon on the next line #12370
Closed
cherryblossom000 opened this issue
Oct 4, 2019
· 3 comments
· Fixed by #12378, basics/vector#111, basics/vector#113, thinkwee/thinkwee.github.io#39 or alxtford/numconv#46
Closed
curly: multi-or-nest option reports an error for a single-statment block with a semicolon on the next line #12370
cherryblossom000 opened this issue
Oct 4, 2019
· 3 comments
· Fixed by #12378, basics/vector#111, basics/vector#113, thinkwee/thinkwee.github.io#39 or alxtford/numconv#46
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
Hacktoberfest
Recommended issue for those participating in Hacktoberfest https://hacktoberfest.digitalocean.com/
help wanted
The team would welcome a contribution from the community for this issue
rule
Relates to ESLint's core rules
Comments
cherryblossom000
added
bug
ESLint is working incorrectly
triage
An ESLint team member will look at this issue soon
labels
Oct 4, 2019
cherryblossom000
changed the title
curly: multi-or-nest option reports an error for a single-statment block with no braces before a line beginning with a semicolon
curly: multi-or-nest option reports an error for a single-statment block with a semicolon on the next line
Oct 4, 2019
I think the issue is here: Lines 99 to 104 in c47fa0d
console.log('some statement')
; |
Verified using our demo. Nice find! Definitely seems like we should use the previous token for this check in this case. |
kaicataldo
added
accepted
There is consensus among the team that this change meets the criteria for inclusion
rule
Relates to ESLint's core rules
Hacktoberfest
Recommended issue for those participating in Hacktoberfest https://hacktoberfest.digitalocean.com/
help wanted
The team would welcome a contribution from the community for this issue
and removed
triage
An ESLint team member will look at this issue soon
labels
Oct 4, 2019
I fixed it in #12378. |
This was referenced Mar 11, 2020
This was referenced Mar 26, 2020
This was referenced Apr 3, 2020
eslint-deprecated
bot
added
the
archived due to age
This issue has been archived; please open a new issue for any further discussion
label
May 1, 2020
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
Hacktoberfest
Recommended issue for those participating in Hacktoberfest https://hacktoberfest.digitalocean.com/
help wanted
The team would welcome a contribution from the community for this issue
rule
Relates to ESLint's core rules
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
I used the following code in
file.js
:The issue occurs whenever the statement in the if block (or any block) has the semicolon on the following line.
Then I linted it:
What did you expect to happen?
No error would occur as there is only 1 statement in the if block.
What actually happened? Please include the actual, raw output from ESLint.
I got the following error:
When fixing it with
eslint --fix file.js
, it gets changed towhich conflicts with the
"semi": [2, "never"]
rule as that would change it to:which would cause
curly
to reportUnnecessary { after 'if' condition
.Are you willing to submit a pull request to fix this bug?
Yes.
The text was updated successfully, but these errors were encountered: