-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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: curly multi-or-nest flagging semis on next line (fixes #12370) #12378
Update: curly multi-or-nest flagging semis on next line (fixes #12370) #12378
Conversation
Thanks for the PR! Marking as accepted, as the issue is accepted. Can this change also produce more warnings? For example, in some rare situations like this: /* eslint curly: ["error", "multi-or-nest"] */
if (foo) {
bar()
;
} |
Yes, this change does produce those warnings. I added more tests for that. |
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.
Thanks for the detailed tests!
Could you please also change the commit message and PR title to start with "Update:" instead of "Fix:"? It's because the change can generate more warning and thus requires a semver-minor release.
Check that multi-or-nest it fixes cases like if (foo) { doSomething() ; } and that it ignores cases with an empty statement like if (foo) ;
One small detail I missed before, sorry - 'curly' is the rule's name and should start with a lowercase in commit message and PR title. Other than that, everything else LGTM! |
Actually, please disregard the 'commit message' part. It's okay to change just the PR title because this PR has more than 1 commit, so the PR title will be used as the merge commit message. |
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!
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 for contributing!
@kaicataldo Sorry, ignore the review request. That was accidental. |
Thanks for contributing to ESLint! |
What is the purpose of this pull request? (put an "X" next to item)
[x] Bug fix
Fixes #12370.
What changes did you make? (Give an overview)
I made the
isOneLiner
function use the last token excluding the semicolon instead of just the last token, like theisCollapsedOneLiner
function, which stopped multi-or-nest flagging code like the following as one line.Is there anything you'd like reviewers to focus on?
No.