Skip to content

Unused CSS Selector warning not appearing #94

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

Closed
mustafa0x opened this issue Dec 1, 2019 · 10 comments · Fixed by #127
Closed

Unused CSS Selector warning not appearing #94

mustafa0x opened this issue Dec 1, 2019 · 10 comments · Fixed by #127
Labels

Comments

@mustafa0x
Copy link
Contributor

It shows in the REPL, but not when running locally.

@Conduitry
Copy link
Member

Weird. I'm seeing this with sveltejs/template, but I haven't looked into whether this is an issue with the compiler (probably not), the rollup plugin, or the template. We can move this issue once we find out who's causing it.

@Conduitry
Copy link
Member

It looks like rollup-plugin-svelte is specifically suppressing this warning, and has been for quite a while, which surprised me. I've inquired into what's intended here.

@Conduitry Conduitry transferred this issue from sveltejs/svelte Jan 30, 2020
@mcmxcdev
Copy link

I think this issue can be closed, just verified that it reports any unused styles.

2020-06-25_10-37

@mustafa0x
Copy link
Contributor Author

I'm still not getting warnings.

{
  "devDependencies": {
    "npm-run-all": "^4.1.5",
    "rollup": "^2.18.1",
    "rollup-plugin-commonjs": "^10.1.0",
    "rollup-plugin-livereload": "^1.3.0",
    "rollup-plugin-node-resolve": "^5.2.0",
    "rollup-plugin-svelte": "^5.2.3",
    "rollup-plugin-terser": "^6.1.0",
    "sirv-cli": "^1.0.2",
    "svelte-routing": "^1.4.2",
    "svelte": "^3.23.2"
  }
}

@mcmxcdev
Copy link

Not sure if that is the actual problem, but you are using some outdated packages:

"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-node-resolve": "^8.1.0"

These rollup dependencies switched to scoped package naming, so you are actually behind my 3 major versions.

@mustafa0x
Copy link
Contributor Author

Thanks, didn't help though. I also tried now with a fresh instance of svelte-template.

@Bravilogy
Copy link

@mustafa0x Hi, did you figure this out? I have the same exact issue here..

@mustafa0x
Copy link
Contributor Author

No, I didn't. I still don't get any warnings.

@mustafa0x
Copy link
Contributor Author

mustafa0x commented Sep 2, 2020

Line of code that is causing this:
https://github.com/sveltejs/rollup-plugin-svelte/blob/master/index.js#L255

The issue where Rich clarifies the motivation:
#17

The PR where the code was committed.
#22

So, in light of the above it seems this error was supposed to be silenced only css: false.

Edit: seems like this commit is what caused this error to always be silenced:
1b541b3#diff-1fdf421c05c1140f6d71444ea2b27638L133

@Bravilogy
Copy link

@mustafa0x thank you, that's very helpful! I was just starting to dig into the code myself. :)

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.

4 participants