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

only check selector that are direct children of :global #6435

Merged
merged 10 commits into from
Jun 29, 2021
Merged

only check selector that are direct children of :global #6435

merged 10 commits into from
Jun 29, 2021

Conversation

ignatiusmb
Copy link
Member

Fixes #6434

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

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

I think it would be better to split the valid selectors into a separate test.
Also I think the regex is too permissive because it doesn't catch global(:is(div, h1), h2)

@ignatiusmb
Copy link
Member Author

I was hoping to get away without using assertions, guess I forgot an edge case there. Separated the tests and made the pattern stricter.

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

src/compiler/compile/css/Selector.ts Outdated Show resolved Hide resolved
@tanhauhau tanhauhau merged commit 8c3fb92 into sveltejs:master Jun 29, 2021
@ignatiusmb ignatiusmb deleted the i6434/strict-global-class-check branch June 29, 2021 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

:where breaks :global in 3.38.3
3 participants