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

Fix stylelint-disable-next-line disables autofix for entire file #6583

Closed
SoundOfTheSky opened this issue Jan 19, 2023 · 1 comment
Closed

Comments

@SoundOfTheSky
Copy link

What steps are needed to reproduce the bug?

Disable rule for one line somewhere in one file.
Example:

.my-block {
  <- Will not be autofixed
  width: 160px;

  /* stylelint-disable-next-line declaration-empty-line-before */
  height: 160px;
}

What Stylelint configuration is needed to reproduce the bug?

{
  "rules": {
    "declaration-empty-line-before": [
      "always",
      {
        "except": ["after-declaration", "first-nested"],
        "ignore": ["after-comment", "inside-single-line-block"]
      }
    ]
  }
}

How did you run Stylelint?

npx stylelint "src/**/*.{css,scss,sass}" --fix

Which version of Stylelint are you using?

14.16.1

What did you expect to happen?

Code above autofixed to this:

.my-block {
  width: 160px;

  /* stylelint-disable-next-line declaration-empty-line-before */
  height: 160px;
}

What actually happened?

The following problems were reported:

test.scss
3:3  ✖  Unexpected empty line before declaration  declaration-empty-line-before

Does the bug relate to non-standard syntax?

No

Proposal to fix the bug

No response

@jeddy3
Copy link
Member

jeddy3 commented Jan 19, 2023

@SoundOfTheSky Thanks for the report and for using the template.

Dupe of #2643. Feel free to contribute a solution to the issue.

@jeddy3 jeddy3 closed this as completed Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants