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 vendor-prefixed image-set w/ unit "x" in unit-no-unknown #4653

Closed
srawlins opened this issue Mar 18, 2020 · 0 comments · Fixed by #4654
Closed

Fix false positives for vendor-prefixed image-set w/ unit "x" in unit-no-unknown #4653

srawlins opened this issue Mar 18, 2020 · 0 comments · Fixed by #4654
Labels
status: wip is being worked on by someone type: bug a problem with a feature or rule

Comments

@srawlins
Copy link
Contributor

srawlins commented Mar 18, 2020

Clearly describe the bug

The unit-no-unknown rule reports a false positive when using the "x" unit in a value for a vendor-prefixed image-set property value. E.g.

a { background-image: -webkit-image-set('img-1x.jpg' 1x, 'img-2x.jpg' 2x) }

caniuse mentions that -webkit-image-set is a valid vendor-prefixed version of image-set: https://caniuse.com/#feat=css-image-set

(slight change to "ignore x unit in image-set" test case in lib/rules/unit-no-unknown/tests/index.js)

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

unit-no-unknown

What code is needed to reproduce the bug?

a { background-image: -webkit-image-set('img-1x.jpg' 1x, 'img-2x.jpg' 2x) }

What stylelint configuration is needed to reproduce the bug?

{
  "rules": {
    "unit-no-unknown": "always"
  }
}

Which version of stylelint are you using?

13.2.1

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

CLI; npm run test

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

No

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:

{
  "column": 54,
  "line": 1,
  "rule": "unit-no-unknown",
  "severity": "error",
  "text": "Unexpected unknown unit \"x\" (unit-no-unknown)",
}

I can write and send a PR.

srawlins added a commit to srawlins/stylelint that referenced this issue Mar 19, 2020
@jeddy3 jeddy3 changed the title unit-no-unknown does not consider vendor-prefixed image-set w/ unit "x" Fix false positives for vendor-prefixed image-set w/ unit "x" in unit-no-unknown Mar 20, 2020
@jeddy3 jeddy3 added status: wip is being worked on by someone type: bug a problem with a feature or rule labels Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: wip is being worked on by someone type: bug a problem with a feature or rule
2 participants