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-before #3442
Add autofix to block-closing-brace-newline-before #3442
Conversation
block-closing-brace-newline-before
…k-closing-brace-newline-before # Conflicts: # docs/user-guide/rules.md
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 work!
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.
@ota-meshi Thanks for starting this.
I've added a question about the three new tests.
message: messages.rejectedBeforeMultiLine, | ||
line: 3, | ||
column: 8 | ||
}, | ||
{ |
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.
Can you explain these tests, please?
I'd expected a { color: pink;;;\ntop: 0; ;;}
and a { color: pink;;;\ntop: 0;; ;}
to be accepted as neither has a newline before the closing brace.
a { color: pink;;;\ntop: 0; ; ; }
does, but the spacing between the semicolons is transformed to a { color: pink;;;\ntop: 0;;;}
.
I understand these are edge-cases, and if these artifacts are due to an unavoidable implementation detail then I'm happy to stick with them... I'd just like to understand them :)
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.
"never-multi-line"
option does not allow whitespace before closing brace.
It can be understood also from the test case of "a { color: pink;\ntop: 0; }"
.
Also, when I tried, "a { color: pink;;;\ntop: 0; ;;}"
and "a { color: pink;;;\ntop: 0;; ;}"
is not allowed with this option.
If used the --fix
option, no error is reported, so all errors need to be resolved,
"a { color: pink;;;\ntop: 0; ; ; }"
is transformed to "a { color: pink;;;\ntop: 0;;;}"
.
|
e.g. "Closes #000" or "None, as it's a documentation fix."
block-closing-brace-newline-before
in #2829e.g. "No, it's self explanatory."
ex.
option:
always***
code:
fixed:
option:
never***
code:
fixed: