Skip to content
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
Merged

Add autofix to block-closing-brace-newline-after #3443

merged 2 commits into from
Jul 21, 2018

Conversation

ota-meshi
Copy link
Member

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) {
Copy link
Member

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") {

Copy link
Member

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) {
Copy link
Member

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") {

Copy link
Member

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.

Copy link
Member

@hudochenkov hudochenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

@jeddy3 jeddy3 changed the title Add autofix to block-closing-brace-newline-after Add autofix to block-closing-brace-newline-after Jul 21, 2018
@jeddy3 jeddy3 merged commit 8e28932 into stylelint:master Jul 21, 2018
@jeddy3
Copy link
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
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants