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 false positives for variable name and important annotation in at-rule-no-unknown #5210

Closed
ssivanatarajan opened this issue Mar 25, 2021 · 4 comments
Labels
status: ready to implement is ready to be worked on by someone syntax: less relates to Less and Less-like syntax type: bug a problem with a feature or rule upstream relates to an upstream package

Comments

@ssivanatarajan
Copy link
Contributor

ssivanatarajan commented Mar 25, 2021

Clearly describe the bug

There are false positive for at-rule-unknown rule in less , if there is no space between proprty and variable

Which rule, if any, is the bug related to?

at-rule-unknown

What code is needed to reproduce the bug?

.a() {
    @box-shadow:none !important;
}

What stylelint configuration is needed to reproduce the bug?

{
  "rules": {
     "at-rule-no-unknown": true,
  }
}

Which version of stylelint are you using?

13.12.0

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

Node JS API

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

Yes, it's related to Less properties

What did you expect to happen?

No warnings to be flagged.

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

"The following warnings were flagged:"

Unexpected unknown at-rule "@box-shadow:none"

@ssivanatarajan ssivanatarajan changed the title at-rule-no-unknown false positive for less at-rule-no-unknown false positive for less code Mar 26, 2021
@jeddy3
Copy link
Member

jeddy3 commented Mar 26, 2021

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

I can reproduce this using the demo with:

@var:value !important;

Please consider contributing to the parser if you have time.

@jeddy3 jeddy3 changed the title at-rule-no-unknown false positive for less code Fix false positives for variable name and important annotation in at-rule-no-unknown Mar 26, 2021
@jeddy3 jeddy3 added status: ready to implement is ready to be worked on by someone syntax: less relates to Less and Less-like syntax type: bug a problem with a feature or rule upstream relates to an upstream package labels Mar 26, 2021
@ssivanatarajan
Copy link
Contributor Author

@jeddy3 so do i need to fix this issue in https://github.com/shellscape/postcss-less ?

@jeddy3
Copy link
Member

jeddy3 commented Mar 26, 2021

I believe so, although not 100% sure. You'll need to test how the parser parses:

@var:value !important;

If the AST doesn't look correct, you should report an issue with that package. The author of the parser usually welcomes pull requests to fix issues like this.

@jeddy3
Copy link
Member

jeddy3 commented Jan 18, 2022

Closing as the syntax option was removed for the 14.0.0 release. (See the migration guide.)

Please consider fixing the issue upstream as the syntax is no longer bundled by Stylelint.

@jeddy3 jeddy3 closed this as completed Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready to implement is ready to be worked on by someone syntax: less relates to Less and Less-like syntax type: bug a problem with a feature or rule upstream relates to an upstream package
Development

No branches or pull requests

2 participants