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
Change selector-pseudo-*-allowed-list
not to include vendor prefixes automatically
#7542
Comments
selector-pseudo-*-allowed-list
automatically allows vendor prefixed equivalents
@carlosjeurissen Thanks for opening the discussion. The suggestion seems to make sense to me. Vendor prefixes have been gradually less used, and people can easily migrate their config to keep the current behavior if they want. E.g. {
"selector-pseudo-class-allowed-list": [/^(-webkit-|-moz-)?hover$/]
} But indeed, this can be a breaking change, even if it is a false positive. So, I think it's better to change in the next major release. |
Ref stylelint/docs/about/semantic-versioning.md Lines 29 to 33 in c49f9b5
|
@ybiquitous if we want to be extra careful we can indeed wait until a major release for this change to be implemented. However I do not see a single use-case of automatically allow-listing vendor prefixes. If you have one please let me know! Even the any-link example makes no sense as their is :link and :visited as fallbacks. If we really want to wait, it could make sense to offer an option to the pseudo-allowed-list rules named "allowVendorPrefixes", which would be true by default until a major release. 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" |
The
I also don't have a use case, but I'm still concerned about the compatibility. Even if adding an option like |
If we are going the option way, I would prefer something like
wouldn't be expected to not be permitted for
You can't change the statu quo default boolean value before a major release though. |
@Mouvedia This would be expected if the allowlist only contains "-moz-last-node". @ybiquitous Fair. The option in a next version would indeed be pretty useless unless people like it as a feature. Yet again I do not see a use case for this. Lets be safe and wait for a next major version and skip having an option for this. Let me know if I can provide a PR and what the process for a delayed PR would be. |
selector-pseudo-*-allowed-list
automatically allows vendor prefixed equivalentsselector-pseudo-*-allowed-list
not to include vendor prefixes automatically
I added this issue to the list in #7396, preparing 17.0.0. |
related: #7624 |
see also i.e. the name chosen will have to be consistent for all affected rules |
What is the problem you're trying to solve?
Currently, when just
hover
is specified in the allowlist,-webkit-hover
will be allowed as well even tho:-webkit-hover
is invalid. This is pretty unexpected for pseudo classes / elements. Considering::-moz-focusring
,:-webkit-full-screen
)What solution would you like to see?
It would make more sense to explicitly add desired vendor prefixed pseudo elements/classes to the allowlist.
This can potentially be a breaking change. However:
The text was updated successfully, but these errors were encountered: