stylelint: Comment got duplicated when put above a SCSS dollar variable

What minimal example or steps are needed to reproduce the bug?

// Comment
$variable: 1rem;

What minimal configuration is needed to reproduce the bug?

None

How did you run Stylelint?

stylelint \"src/**/*.scss\" --fix

Which Stylelint-related dependencies are you using?

{
    "stylelint": "^16.2.0"
}

What did you expect to happen?

// Comment
$variable: 1rem;

What actually happened?

// Comment
$variable: 1rem;Comment$variable

Do you have a proposal to fix the bug?

It might have been something with the dollar variable configuration of stylelint. I will take a look.

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 15 (14 by maintainers)

Most upvoted comments

I’ve opened an issue #7497 for the autofix problem.

Here’s an online demo. It raises a syntax error. So, specifying customSyntax: postcss-scss is correct, as @jeddy3 suggested.

But no-invalid-double-slash-comments autofix seems to have a problem.

Yep it also raises a syntax error but the incorrect autofix was still applied. As you and @jeddy3 said, seems like customSyntax: postcss-scss stopped it. Thank you!