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 jQuery CSS function in value-keyword-case #4919

Closed
Tracked by #4574
lambert-velir opened this issue Sep 1, 2020 · 2 comments
Closed
Tracked by #4574
Labels
status: ready to implement is ready to be worked on by someone syntax: css-in-js relates to JS objects & template literals type: bug a problem with a feature or rule upstream relates to an upstream package

Comments

@lambert-velir
Copy link

lambert-velir commented Sep 1, 2020

$(".class").css({
  width: 100 * (slick.options.slidesToShow / slick.slideCount) + "%",
});

In this example in a javascript file, stylelint is changing slidesToShow to slidestoshow

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

value-keyword-case

What stylelint configuration is needed to reproduce the bug?

e.g.

{
  "rules": {
    "value-keyword-case": "lower",
  }
}

Which version of stylelint are you using?

13.3.3

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

stylelint command line and vscode extension (atom extension does not seem to lint js files)

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

no

I'm not sure what the best solution is for this. Can stylelint be smart enough to only apply this rule to strings in this case of an object of styles?

@jeddy3 jeddy3 changed the title $(".jquery").css value-keyword-case Fix false positives for jQuery CSS function in value-keyword-case Sep 13, 2020
@jeddy3 jeddy3 mentioned this issue Sep 13, 2020
23 tasks
@jeddy3 jeddy3 added syntax: css-in-js relates to JS objects & template literals type: bug a problem with a feature or rule upstream relates to an upstream package status: ready to implement is ready to be worked on by someone labels Sep 13, 2020
@jeddy3
Copy link
Member

jeddy3 commented Sep 13, 2020

@lambert-velir Thanks for the report.

I can reproduce this using the demo.

It's likely a problem with the parser stylelint uses to support CSS-in-JS. I've added this issue to #4574, which is a growing list of the problems with the syntax that we need help to fix.

Please consider contributing to the parser if you have time.

@jeddy3
Copy link
Member

jeddy3 commented Jan 18, 2022

Closing as stylistic rules are frozen. The community is welcome to migrate the rule to a plugin and fix this bug.

@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: css-in-js relates to JS objects & template literals type: bug a problem with a feature or rule upstream relates to an upstream package
Development

No branches or pull requests

2 participants