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 for ::part in selector-pseudo-element-no-unknown #4589

Closed
bennypowers opened this issue Feb 10, 2020 · 2 comments · Fixed by #4604
Closed

Fix false positives for ::part in selector-pseudo-element-no-unknown #4589

bennypowers opened this issue Feb 10, 2020 · 2 comments · Fixed by #4604
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

@bennypowers
Copy link
Member

What is the problem you're trying to solve?

Using CSS Shadow Parts violates linter rules selector-pseudo-element-no-unknown for the ::part pseudo element and selector-type-no-unknown for the argument to ::part()

What solution would you like to see?

I would like to see theselector-pseudo-element-no-unknown rule updated to allow CSS Shadow Part selection.

stripe-elements::part(stripe) {
  border: none;
  box-shadow: none;
}

A plugin that scans custom-elements.json files for a all custom-elements imported by the project and validates the names of their Shadow Parts would be amazing, but is perhaps out of scope of this request.

@alexander-akait
Copy link
Member

Feel free to send a PR with new pseudo elements, you can name then shadowTreePseudoElements https://github.com/stylelint/stylelint/blob/master/lib/reference/keywordSets.js#L205

@alexander-akait alexander-akait added good first issue is good for newcomers type: bug a problem with a feature or rule labels Feb 10, 2020
@jeddy3 jeddy3 added the status: ready to implement is ready to be worked on by someone label Feb 10, 2020
@jeddy3
Copy link
Member

jeddy3 commented Feb 10, 2020

@bennypowers Thanks for the request and for using the template.

(For anyone curious: spec for reference.)

I've labeled the issue as ready to implement. As @evilebottnawi said, please consider contributing if you have time. You can add the new set here and you'll need to unite it here.

There are steps on how to fix a bug in a rule in the Developer guide.

A plugin that scans custom-elements.json files for a all custom-elements imported by the project and validates the names of their Shadow Parts would be amazing

Yes, this is out of scope for a built-in rule but would make for an excellent plugin!

@jeddy3 jeddy3 changed the title Support for CSS Shadow Parts Fix false positives for ::part in selector-pseudo-element-no-unknown Feb 10, 2020
jeddy3 pushed a commit that referenced this issue Feb 16, 2020
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

Successfully merging a pull request may close this issue.

3 participants