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
#7624
Comments
@Mouvedia Thanks for the report. Supporting the And, adding regex support to the Just to be sure, I have a few questions:
|
If you are talking about properties there are 3 AFAIK:
It will but it's not problematic. The problem is that this fix requires to update the There are 2 alternatives:
I vote for 2 because you can do exact match using regexes too. If so a new issue will have to be created akin to #7542. tl;dr: the fix for
Adding all the prefixes that ever existed makes sense. |
Okay. For EDIT: Because many people may not know the |
Just to confirm, does this update mean the following in my previous comment (#7624 (comment))? 👇🏼
|
Yes, Iv linked to it in #7016 (review)
👍
If I did the PR, I would add support for |
Sorry, I can't still understand what you mean... It seems that it's not breaking to change |
It depends on how you proceed :) Currently So until the next major there will be inconsistencies between |
Ah, I now understand the problem here. 😅 The current stylelint/lib/rules/value-no-vendor-prefix/index.mjs Lines 55 to 57 in 9959110
Indeed, this may a breaking change. So, cannot we add the regex support, keeping compatibility? 🤔 E.g. if (optionsMatches(secondaryOptions, 'ignoreValues', vendor.unprefixed(value))) {
return;
}
+if (optionsMatches(secondaryOptions, 'ignoreValues', value)) {
+ return;
+} |
You can probably parse |
Hum, I'd like to avoid parsing the option values since it seems too complicated... 🤔 |
@ybiquitous Should I create another issue for |
@Mouvedia Yes, please create another issue. For the secondary option, I guess:
After the processes completes, we can fix false negatives reported in this issue. Any thoughts? |
Done.
I will only do it if the value starts with a known prefix.
|
Agree. We'd like to release |
While working on a fix 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.What minimal example or steps are needed to reproduce the bug?
What minimal configuration is needed to reproduce the bug?
How did you run Stylelint?
https://stylelint.io/demo
Do you have a proposal to fix the bug?
replace
stylelint/lib/reference/prefixes.mjs
Line 1 in 9959110
by
Resources
Caveat
system
will have to be added tohttps://github.com/stylelint/stylelint-config-standard/blob/3c610c147cc6c20b9e24292ff002b4637d55d3bc/index.js#L117
because it's used in many code bases as part of the default system font stack values.
Other values, like
-apple-system-body
, are rarely used, so it doesn't matter as much.There are 64 values that start with "-apple-system" supported by Safari.
see https://github.com/WebKit/WebKit/blob/main/Source/WebCore/css/CSSValueKeywords.in
Hence being able to ignore them using a regex is essential.
e.g.
["/^-apple-system/"]
So this fix will have to be introduced alongside an update of
ignoreValues
.e.g.
from
to
The text was updated successfully, but these errors were encountered: