stylus / stylelint-stylus

Stylelint plugin for Stylus
https://stylus.github.io/stylelint-stylus/
MIT License
24 stars 0 forks source link

Semicolon is added after single line comment #25

Open robertmaier opened 9 months ago

robertmaier commented 9 months ago

Hey there :) I've just tried to add stylelint-stylus to our codebase and came across a bug in the semicolon rule.

using "stylus/semicolon": "always", the semicolon is added after the single line comment

before: height: 40px // comment

after: height: 40px // comment;

this causes the linter to still throw an error, as the semicolon is not part of the code, but part of the comment

ota-meshi commented 9 months ago

Thank you for posting the issue! It may be a bug in stringify of postcss-styl.

robertmaier commented 9 months ago

possibly. I tried to debug it and was confused about the comment not showing up in the AST

gapkukb commented 2 months ago

Thank you for posting the issue! It may be a bug in stringify of postcss-styl.

And there has a same problem unexcepted semicolon with stylelint-config-recess-order plugin.

for example:

body
  color red
  font-weight 500

with vscode autosave format will get the result: more semicolon appear which property has be reordered

body
  font-weight 500;
  color red