Stylelint: Fix CssSyntaxError for unclosed comment

Created on 18 Feb 2019  Â·  3Comments  Â·  Source: stylelint/stylelint

What CSS is needed to reproduce the bug?

// stylelint-disable value-keyword-case

//** Background color for `<body>`.

What stylelint configuration is needed to reproduce the bug?

https://github.com/twbs/bootstrap/blob/v3-dev/grunt/.stylelintrc

Which version of stylelint are you using?

9.10.1

How are you running stylelint: CLI, PostCSS plugin, Node.js API?

Via grunt-stylelint

Does the bug relate to non-standard syntax (e.g. SCSS, Less etc.)?

It's related to Less

What did you expect to happen?

No warnings to be flagged.

What actually happened (e.g. what warnings or errors did you get)?

$ grunt stylelint
Running "stylelint:dist" (stylelint) task

less/variables.less
 3:2  ×  Unclosed comment   CssSyntaxError

✖ 1 problem

Note that this doesn't happen with v9.6.0.

Maybe it was intended to break I just wanted to report it. Basically the //** confuses the parser thinking it's an unclosed /* comment */.

ready to implement less bug

All 3 comments

@XhmikosR Thanks for the report and for using the template. I can reproduce this.

I've raised an issue upstream in the Less parser stylelint uses: https://github.com/shellscape/postcss-less/issues/135

If you've any experience with parsers, feel free to help fix this issue upstream.

Thanks! I wasn't sure if it's a parser issue that's why I reported it here. I'm gonna watch the upstream discussion.

This might be a regression in postcss-less 3.x, but I'm not 100% sure. I know for sure stylelint 9.6.0 works fine.

This is fixed upstream in [email protected] so a fresh npm install should take care of it automatically.

Was this page helpful?
0 / 5 - 0 ratings