-
-
Notifications
You must be signed in to change notification settings - Fork 929
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 selector-pseudo-*-allowed-list
false positives for vendor prefixes
#7524
Comments
In general one might wonder why we even ignore the vendor prefix in the first place. |
@carlosjeurissen Thanks for the report and pull request. Right, this is a bug. We also can see the reproducible demo: button:-moz-focus-inner,
button::-moz-focus-inner {
display: none;
}
|
selector-pseudo-*-allowed-list
false positives for vendor prefixed values
selector-pseudo-*-allowed-list
false positives for vendor prefixed valuesselector-pseudo-*-allowed-list
false positives for vendor prefixes
@ybiquitous Thanks for merging! What are your thoughts on accepting / rejecting vendor prefixes when they are not included in the allowlist? Currently, when just "box-shadow" is specified in the allowlist, "-webkit-box-shadow" will be allowed as well. Which seems odd. Do you feel it makes sense to change this? Alternatively we can add an option to the pseudo-allowed-list rules named "allowVendorPrefixes", which would be true by default. I can make a PR for this. |
This is a demo. I feel that makes sense because we usually use a vendor prefix with a non-prefixed value. Is there a case when you want to exclude only a vendor prefix? |
@ybiquitous Personally I want to explicitly allowlist specific vendor-prefixes when it comes to pseudo classes and elements as the vendor prefixes often do not have a non-prefixed version or the non prefixed version works differently than the prefixed version. What I hear is you like the default to stay as it is. Would you have any objections in a PR which adds an option allowing explicit specifications of vendor prefixes? So that: "selector-pseudo-class-allowed-list": [[
"hover", "-moz-last-node"
], {
"includeVendorPrefixed": false
}] Would not allow ":-moz-hover" or ":last-node" but would allow ""-moz-last-node" and "hover" |
@carlosjeurissen Although you might want to use the Probably, I feel like it would be better not to include vendor prefixes by default (without any options), but this idea leads to breaking the rule's backward compatibility. Anyway, can you open a new issue about this topic? Let's discuss it there. |
@ybiquitous Sure. That makes a lot of sense. Created a new issue: |
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?
CLI
Which Stylelint-related dependencies are you using?
What did you expect to happen?
For it to pass without any errors.
What actually happened?
It rejects the pseudo element since "focus-inner" is not in the allowed-list.
Do you have a proposal to fix the bug?
Yes: #7525
The text was updated successfully, but these errors were encountered: