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 rule-selector-property-disallowed-list false positives for nesting selectors #7558

Conversation

romainmenke
Copy link
Member

@romainmenke romainmenke commented Mar 13, 2024

Which issue, if any, is this issue related to?

Closes #7488

Is there anything in the PR that needs further explanation?

I noticed that this walks down the entire sub tree for each rule node.
This might not be what users expect.

But changing it to .each() also has issues.
It will no longer give errors on :

.bad-selector {
  @media screen {
    color: red;
  }
}

Edit: I've found a more complete patch

Copy link

changeset-bot bot commented Mar 13, 2024

🦋 Changeset detected

Latest commit: 1c6b2a0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ybiquitous
Copy link
Member

@romainmenke Thank you for the pull request! This is just an idea, but how about resolving and flattening selectors like #7518?

@ybiquitous
Copy link
Member

ybiquitous commented Mar 14, 2024

resolving and flattening selectors

Umm... I realized that this way is problematic, as #7557 describes.

romainmenke and others added 7 commits March 14, 2024 18:06
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
…alse-positives-for-nesting-selectors--intuitive-indian-palm-squirrel-030052a111
@romainmenke romainmenke marked this pull request as ready for review March 14, 2024 17:20
@romainmenke
Copy link
Member Author

Thank you for the review @ybiquitous 🙇

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM 👍🏼

@ybiquitous ybiquitous merged commit 8a3f67e into main Mar 15, 2024
14 checks passed
@ybiquitous ybiquitous deleted the fix-rule-selector-property-disallowed-list-false-positives-for-nesting-selectors--intuitive-indian-palm-squirrel-030052a111 branch March 15, 2024 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Fix rule-selector-property-disallowed-list false positives for nesting selectors
2 participants