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

False positive in declaration-empty-line-before rule #492

Closed
chalkygames123 opened this issue Sep 20, 2020 · 1 comment
Closed

False positive in declaration-empty-line-before rule #492

chalkygames123 opened this issue Sep 20, 2020 · 1 comment

Comments

@chalkygames123
Copy link
Contributor

chalkygames123 commented Sep 20, 2020

I'm not sure if this should open here or https://github.com/stylelint/stylelint, but I decided here because the problem only occurs with SCSS-specific syntax.

With the following configuration, a declaration followed by two consecutive double-slash comments is considered a violation by declaration-empty-line-before rule unexpectedly.

// .stylelintrc.js

module.exports = {
  rules: {
    'declaration-empty-line-before': [
      'always',
      {
        ignore: ['after-comment'],
      },
    ],
  },
}

Example SCSS code:

html {
  // foo
  // bar
  display: block;
}

When we remove either one of these comments, the error disappears.

I don't know if it's related, with the following code, the stylelint-disable comment is completely ignored, and thus an error reported.

html {
  // foo
  // stylelint-disable-next-line
  display: block;
}

My environment:

  • stylelint v13.7.1
  • stylelint-scss v3.18.0

Am I doing something wrong?

@chalkygames123 chalkygames123 changed the title False position in declaration-empty-line-before rule False positive in declaration-empty-line-before rule Sep 20, 2020
@chalkygames123
Copy link
Contributor Author

It seems to have been fixed in stylelint/stylelint#4913.

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

1 participant