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 value-no-vendor-prefix false negatives #7654

Merged
merged 2 commits into from Apr 25, 2024

Conversation

Mouvedia
Copy link
Member

@Mouvedia Mouvedia commented Apr 25, 2024

Which issue, if any, is this issue related to?

related to #7624

Is there anything in the PR that needs further explanation?

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.

Copy link

changeset-bot bot commented Apr 25, 2024

🦋 Changeset detected

Latest commit: f5f8186

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Minor

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

@Mouvedia Mouvedia changed the title Fix value/selector-no-vendor-prefix false negatives Fix value/selector-no-vendor-prefix false negatives [WIP] Apr 25, 2024
@Mouvedia Mouvedia changed the title Fix value/selector-no-vendor-prefix false negatives [WIP] Fix value-no-vendor-prefix false negatives Apr 25, 2024
@@ -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.
Copy link
Member Author

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.
Copy link
Member Author

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; }
Copy link
Member Author

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

Comment on lines +32 to +33
code: 'a { white-space: -pre-wrap; }',
description: 'ignores non-vendor prefixed values',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +114 to +115
code: '.foo { display: -khtml-box; }',
fixed: '.foo { display: box; }',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +141 to +142
code: '.foo { speak: -xv-digits; }',
fixed: '.foo { speak: digits; }',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +159 to +160
code: '.foo { -webkit-user-select: -moz-all; }',
fixed: '.foo { -webkit-user-select: all; }',
Copy link
Member Author

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; }
Copy link
Member Author

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-',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'-xv-',
'-apple-',
'-wap-',
'-khtml-',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. :-khtml-drag

@Mouvedia Mouvedia marked this pull request as ready for review April 25, 2024 22:24
Copy link
Member

@ybiquitous ybiquitous left a 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.

.changeset/serious-bees-burn.md Outdated Show resolved Hide resolved
.changeset/serious-bees-burn.md Outdated Show resolved Hide resolved
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏼

@Mouvedia Mouvedia merged commit 68cb920 into stylelint:main Apr 25, 2024
17 checks passed
@Mouvedia Mouvedia deleted the fix-false-vnvp-snvp branch April 25, 2024 23:44
emmacharp pushed a commit to emmacharp/stylelint that referenced this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Fix value-no-vendor-prefix false negatives
2 participants