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

Merged
merged 2 commits into from Jul 21, 2018

Conversation

4 participants
@ota-meshi
Member

ota-meshi commented Jul 5, 2018

Which issue, if any, is this issue related to?

e.g. "Closes #000" or "None, as it's a documentation fix."

block-closing-brace-newline-after in #2829

Is there anything in the PR that needs further explanation?

e.g. "No, it's self explanatory."

ex.

  • option: always***

    code:

    a { color: pink; } .b { color: red; }

    fixed:

    a { color: pink; }
     .b { color: red; }
  • option: never***

    code:

    a { color: pink; }
    .b { color: red; }

    fixed:

    a { color: pink; }.b { color: red; }
@@ -99,6 +99,22 @@ const rule = function(expectation, options) {
index: -1,
lineCheckStr: blockString(statement),
err: msg => {
if (context.fix) {
if (expectation.indexOf("always") === 0) {

This comment has been minimized.

@gucong3000

gucong3000 Jul 21, 2018

Member

Way not just use:

if (expectation === "always") {

This comment has been minimized.

@hudochenkov

hudochenkov Jul 21, 2018

Member

@gucong3000 It matches always, always-single-line, always-multi-line.

context.newline + nodeToCheck.raws.before;
}
return;
} else if (expectation.indexOf("never") === 0) {

This comment has been minimized.

@gucong3000

gucong3000 Jul 21, 2018

Member

Way not just use:

if (expectation === "never") {

This comment has been minimized.

@hudochenkov

hudochenkov Jul 21, 2018

Member

@gucong3000 It matches never-single-line, never-multi-line.

@hudochenkov

Good job!

@jeddy3 jeddy3 changed the title from Add autofix to `block-closing-brace-newline-after` to Add autofix to block-closing-brace-newline-after Jul 21, 2018

@jeddy3

jeddy3 approved these changes Jul 21, 2018

@jeddy3 jeddy3 merged commit 8e28932 into stylelint:master Jul 21, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.02%) to 96.011%
Details
@jeddy3

This comment has been minimized.

Member

jeddy3 commented Jul 21, 2018

  • Added: block-closing-brace-newline-after autofix (#3443).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment