-
-
Notifications
You must be signed in to change notification settings - Fork 934
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
Add autofix to block-closing-brace-newline-after #3443
Add autofix to block-closing-brace-newline-after #3443
Conversation
@@ -99,6 +99,22 @@ const rule = function(expectation, options) { | |||
index: -1, | |||
lineCheckStr: blockString(statement), | |||
err: msg => { | |||
if (context.fix) { | |||
if (expectation.indexOf("always") === 0) { |
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.
Way not just use:
if (expectation === "always") {
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.
@gucong3000 It matches always
, always-single-line
, always-multi-line
.
context.newline + nodeToCheck.raws.before; | ||
} | ||
return; | ||
} else if (expectation.indexOf("never") === 0) { |
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.
Way not just use:
if (expectation === "never") {
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.
@gucong3000 It matches never-single-line
, never-multi-line
.
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.
Good job!
block-closing-brace-newline-after
|
e.g. "Closes #000" or "None, as it's a documentation fix."
block-closing-brace-newline-after
in #2829e.g. "No, it's self explanatory."
ex.
option:
always***
code:
fixed:
option:
never***
code:
fixed: