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 selector-pseudo-class-no-unknown false negatives for non-standard :slotted #6878

Closed
Mouvedia opened this issue May 31, 2023 · 3 comments · Fixed by #6964
Closed

Fix selector-pseudo-class-no-unknown false negatives for non-standard :slotted #6878

Mouvedia opened this issue May 31, 2023 · 3 comments · Fixed by #6964
Assignees
Labels
good first issue is good for newcomers status: wip is being worked on by someone type: bug a problem with a feature or rule

Comments

@Mouvedia
Copy link
Contributor

Mouvedia commented May 31, 2023

What steps are needed to reproduce the bug?

:slotted(.foo) {}

What Stylelint configuration is needed to reproduce the bug?

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

How did you run Stylelint?

https://stylelint.io/demo/

What did you expect to happen?

Unexpected unknown pseudo-class selector ":slotted"

What actually happened?

no error

Proposal to fix the bug

Distinguish between the pseudo-class—which is vue specific—and the standard pseudo-element.

ref:

@Mouvedia Mouvedia added status: needs discussion triage needs further discussion type: bug a problem with a feature or rule good first issue is good for newcomers labels May 31, 2023
@ybiquitous ybiquitous removed type: bug a problem with a feature or rule good first issue is good for newcomers labels May 31, 2023
@ybiquitous
Copy link
Member

ybiquitous commented May 31, 2023

@Mouvedia Thanks for the report. To confirm, do you mean the ::slotted() pseudo-element, not pseudo-class?

If so, we could see the selector-pseudo-element-no-unknown rule false negative with this demo.

::slotted(.foo) {}
{
  "rules": {
    "selector-pseudo-element-no-unknown": true
  }
}

@Mouvedia
Copy link
Contributor Author

Mouvedia commented May 31, 2023

To confirm, do you mean the ::slotted() pseudo-element, not pseudo-class?

@ybiquitous Ill quote myself:

Distinguish between the pseudo-class—which is vue specific—and the standard pseudo-element.

ref:

So no, I want an error for :slotted() when { "ignorePseudoClasses": [ "slotted"] } is missing for the rule selector-pseudo-class-no-unknown because it's not standard.
e.g. if you switch from vue to react the unknown pseudo-class wouldn't be detected

If so, we could see the selector-pseudo-element-no-unknown rule false negative with this demo.

::slotted() is not unknown.
i.e. in a non-vue project you want to detect that you are not using :slotted() but still allow ::slotted()

@ybiquitous
Copy link
Member

@Mouvedia Thanks for the explanation, and sorry for my misunderstanding. 🙇🏼

I understand your motivation. You mean selector-pseudo-class-no-unknown should error for the non-standard :slotted pseudo-class. This bug is a false negative of selector-pseudo-class-no-unknown.

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

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

@ybiquitous ybiquitous added status: ready to implement is ready to be worked on by someone type: bug a problem with a feature or rule good first issue is good for newcomers and removed status: needs discussion triage needs further discussion labels May 31, 2023
@ybiquitous ybiquitous changed the title Fix false positive for selector-pseudo-class-no-unknown Fix selector-pseudo-class-no-unknown false negative for non-standard :slotted May 31, 2023
@ybiquitous ybiquitous changed the title Fix selector-pseudo-class-no-unknown false negative for non-standard :slotted Fix selector-pseudo-class-no-unknown false negatives for non-standard :slotted May 31, 2023
@Mouvedia Mouvedia self-assigned this Jun 23, 2023
@Mouvedia Mouvedia added status: wip is being worked on by someone and removed status: ready to implement is ready to be worked on by someone labels Jun 23, 2023
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: wip is being worked on by someone type: bug a problem with a feature or rule
2 participants