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

No "unused selector" warning when unused child combinator with universal selector is present #5370

Closed
jlkiri opened this issue Sep 9, 2020 · 1 comment · Fixed by #5400
Closed
Labels

Comments

@jlkiri
Copy link

jlkiri commented Sep 9, 2020

Describe the bug
Svelte does not warn when there is an unused selector of the form element > * inside <style> tags. E.g.:

article > * {
    font-size: 36px;
}

Logs

No logs.

To Reproduce

REPL:
https://svelte.dev/repl/6480b8f41e784418bdae55a163257e21?version=3.24.1

  • Confirm that article > * does not raise warnings.
  • Uncomment the article * selector to see the correctly raised warning.

Expected behavior
A warning should be raised.

Stacktraces
If you have a stack trace to include, we recommend putting inside a <details> block for the sake of the thread's readability:

Stack trace

Stack trace goes here...

Information about your Svelte project:

  • All browsers

  • Latest macOS

  • 3.24.1

  • Rollup

Severity
It took some time to realize this when trying to target elements that are inside the @html string. I then noticed that it is impossible in the first place without using :global but having a warning would be much much better.

Additional context
I can try fixing it myself.

@Conduitry
Copy link
Member

This is fixed in 3.25.1 - https://svelte.dev/repl/6480b8f41e784418bdae55a163257e21?version=3.25.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants