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 false positives in *-no-unknown #5157

Closed
Mouvedia opened this issue Feb 20, 2021 · 5 comments
Closed

Fix false positives in *-no-unknown #5157

Mouvedia opened this issue Feb 20, 2021 · 5 comments
Labels
good first issue is good for newcomers status: ready to implement is ready to be worked on by someone type: bug a problem with a feature or rule

Comments

@Mouvedia
Copy link
Contributor

Some pseudo classes/elements are missing from the whitelists of:

  • selector-pseudo-element-no-unknown
  • selector-pseudo-class-no-unknown

sources

https://www.chromestatus.com/feature/5676301379698688
https://www.chromestatus.com/feature/6537562418053120
https://github.com/css-modules/css-modules

What code is needed to reproduce the bug?

::file-selector-button { }
:state() { }

The list is not exhaustive. Personally I think :global and :local could be considered as well.

What stylelint configuration is needed to reproduce the bug?

{
  "rules": {
    "selector-pseudo-class-no-unknown": true,
    "selector-pseudo-element-no-unknown": true,
  }
}

Which version of stylelint are you using?

https://stylelint.io/demo

What did you expect to happen?

no errors

@jeddy3 jeddy3 changed the title Add missing pseudo classes/elements Fix false positives in selector-pseudo-*-no-unknown Feb 20, 2021
@jeddy3 jeddy3 added good first issue is good for newcomers status: ready to implement is ready to be worked on by someone type: bug a problem with a feature or rule labels Feb 20, 2021
@jeddy3
Copy link
Member

jeddy3 commented Feb 20, 2021

@Mouvedia Thanks for the report and for using the template.

The list is not exhaustive

We'll need to update our reference lists of keywords.

I've labelled the issue as ready to implement. Please consider contributing this if you have time.

Personally I think :global and :local could be considered as well.

The rules consider pseudo-classes and elements from the specifications to be known. Those that belong to methodologies and language extensions can be allowed using the ignorePseudoClasses and ignorePseudoElements options. This lets configuration authors explicitly signal when they are using something outside of the specs.

@Mouvedia
Copy link
Contributor Author

Mouvedia commented Feb 20, 2021

Please consider contributing this if you have time.

@jeddy3 If I did, I would also update the whitelists of selector-type-no-unknown, at-rule-no-unknown and unit-no-unknown; is that a problem?
If so please rename the title to "Fix false positives in *-no-unknown".

@jeddy3
Copy link
Member

jeddy3 commented Feb 20, 2021

@Mouvedia That would be fantastic! Since first creating the sets, we've updated them piecemeal as users have reported missing items. It'd be great to give them the once over as new CSS specifications are constantly being added and it's likely the lists have fallen out of date.

The sets are either broken down by the sections of a specification (and usually accompanied by the URL to the specification in a comment beforehand) or by the needs of a particular rule.

Thank you!

@jeddy3 jeddy3 changed the title Fix false positives in selector-pseudo-*-no-unknown Fix false positives in *-no-unknown Feb 20, 2021
@Mouvedia
Copy link
Contributor Author

Mouvedia commented Feb 20, 2021

It'd be great to give them the once over as new CSS specifications are constantly being added and it's likely the lists have fallen out of date.

Don't dream. I cannot arbitrate all the additions.
e.g. :picture-in-picture may be renamed before it gets implemented
Hence I will just add the ones I had to add exceptions for, in my cfg.

Thank you!

Wait for the PR to thank me :)

Mouvedia added a commit to Mouvedia/stylelint that referenced this issue Feb 20, 2021
- @Property
- nobr tag
- :state()
- ::file-selector-button
- lh, rlh, mozmm units
jeddy3 pushed a commit that referenced this issue Feb 23, 2021
- @Property
- nobr tag
- :state()
- ::file-selector-button
- lh, rlh, mozmm units
@jeddy3
Copy link
Member

jeddy3 commented Feb 23, 2021

Closed in #5158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue is good for newcomers status: ready to implement is ready to be worked on by someone type: bug a problem with a feature or rule
Development

No branches or pull requests

2 participants