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

Fixer won't work if rule block is all on one line #103

Open
ghost opened this issue Nov 14, 2019 · 2 comments
Open

Fixer won't work if rule block is all on one line #103

ghost opened this issue Nov 14, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 14, 2019

Problem Description

When fixing files, the tool fails if there are any instances of sass blocks defined on a single line.

For example, the tool can't cope with this:
&:focus {outline: 1px dotted $neutral; }

But this is fine:

&:focus {
  outline: 1px dotted $neutral;
}

Is this a known issue?

@srowhani
Copy link
Owner

What does it output when it fails? Does the tool halt, or does it just skip the rule?

@ghost
Copy link
Author

ghost commented Nov 15, 2019

npm run sasslint:fix scss\foo.scss

> [email protected] sasslint:fix C:\my-project
> sass-lint-auto-fix --config .sass-lint-auto-fix.yml --config-sass-lint .sass-lint.yml "scss\foo.scss"

@fix       Running resolver "property-sort-order" on "scss/foo.scss"
@error     { line: 10,
  syntax: 'scss',
  css_: '/*\n * Foo \n *\n ********************************************************************************/\n\n.error-page {\n\n  @include bem-e(\'container\') {\n\n{ min-height: 650px; }\n  }\n\n{ max-width: $screen-sm; }\n\n  @include bem-e(\'form\') {\n    margin-top: $grid-vertical-padding;\n\n{ margin-bottom: $grid-vertical-padding; }\n  }\n\n  @include bem-e(\'input\') {\n    border: 1px solid $neutral !important; // override global search input style\n    padding-right: 15px !important; // override global search input style\n\n{ border-color: $brand-primary-blue !important; }\n  }\n\n  @include bem-e(\'list\') {\n\n    @media (min-width: $screen-sm-min) {\n      display: flex;\n      flex-flow: row wrap;\n      width: 70%;\n    }\n  }\n\n  @include bem-e(\'list-item\') {\n    padding-top: 2px;\n    padding-bottom: 2px;\n\n{ width: 50%; }\n\n    a {\n      @include line-height(12, 18);\n      @include font-size(12);\n\n      text-decoration: none;\n      font-family: $primary-font-bold;\n\n      &:focus,\n{ text-decoration: underline; }\n    }\n  }\n}\n' }

The fixer halts on line 10 and isn't able to fix errors below that line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant