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 value-no-vendor-prefix
false negatives
#7654
Conversation
🦋 Changeset detectedLatest commit: f5f8186 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
value/selector-no-vendor-prefix
false negativesvalue/selector-no-vendor-prefix
false negatives [WIP]
542b374
to
9556da2
Compare
value/selector-no-vendor-prefix
false negatives [WIP]value-no-vendor-prefix
false negatives
@@ -9,7 +9,7 @@ a { display: -webkit-flex; } | |||
* This prefix */ | |||
``` | |||
|
|||
This rule ignores non-standard vendor-prefixed values that aren't handled by [Autoprefixer](https://github.com/postcss/autoprefixer). | |||
This rule does not fix vendor-prefixed values that weren't handled by [Autoprefixer](https://github.com/postcss/autoprefixer) version 10.2.5. Exceptions may be added on a case by case basis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added some examples of such cases that happen to be the false negatives that I am fixing in this PR.
see https://github.com/stylelint/stylelint/pull/7654/files#diff-db7ee227393b97a75cdd1e359512825b05fc5e14bfd94e304762622814f41a14
@@ -9,7 +9,7 @@ a { display: -webkit-flex; } | |||
* This prefix */ | |||
``` | |||
|
|||
This rule ignores non-standard vendor-prefixed values that aren't handled by [Autoprefixer](https://github.com/postcss/autoprefixer). | |||
This rule does not fix vendor-prefixed values that weren't handled by [Autoprefixer](https://github.com/postcss/autoprefixer) version 10.2.5. Exceptions may be added on a case by case basis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the version check #5312 (comment)
@@ -75,11 +75,6 @@ a { cursor: -webkit-grab; } | |||
a { list-style-type: -moz-hangul; } | |||
``` | |||
|
|||
<!-- prettier-ignore --> | |||
```css | |||
a { list-style-type: -moz-hangul-consonant; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was technically true that it was being ignored but it was misleading.
i.e. it was ignored because it wasn't part of the variables that are considered unprefixable
see https://github.com/stylelint/stylelint/pull/7654/files#diff-5f9be0b5e6e40c3ad07fc3db2a8895c25da53046e10664c0112bbb9e237893c5R295
code: 'a { white-space: -pre-wrap; }', | ||
description: 'ignores non-vendor prefixed values', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code: '.foo { display: -khtml-box; }', | ||
fixed: '.foo { display: box; }', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code: '.foo { speak: -xv-digits; }', | ||
fixed: '.foo { speak: digits; }', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9556da2
to
afe1a6f
Compare
afe1a6f
to
0600e66
Compare
code: '.foo { -webkit-user-select: -moz-all; }', | ||
fixed: '.foo { -webkit-user-select: all; }', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``` | ||
|
||
<!-- prettier-ignore --> | ||
```css | ||
a { -webkit-appearance: -apple-pay-button; } | ||
a { -moz-user-select: -moz-all; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous example was misleading, -apple-pay-button
is always ignored.
'-o-', | ||
'-xv-', | ||
'-apple-', | ||
'-wap-', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'-xv-', | ||
'-apple-', | ||
'-wap-', | ||
'-khtml-', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g. :-khtml-drag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, overall LGTM. I've left a few suggestions only for the changelog.
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏼
related to #7624
While working on #7624 I realised how the rule was intended to work. We can't change that behaviour after the fact.
It reports if the value can be unprefixed safely, else it bails-out.
In practice this is what you want and actually that's better for us: we don't have to update
stylelint-config-standard
with an-apple-system
exception anymore because it is not an unprefixable value.This PR mainly fixes the documentation and some false negatives.
We can close #7624 after that because it's not on scope with the rule.
I didn't add all the missing values; I might some day.
I couldn't find use cases for
-konq-
so I left it out.