css-blocks icon indicating copy to clipboard operation
css-blocks copied to clipboard

Editor/IDE/linting support for deleting dead css

Open devinrhode2 opened this issue 6 years ago • 3 comments

Css-blocks seems really awesome, and on further investigation, I think it will be the GOTO solution for css once it has reached 1.0 status

One thing I am curious about - I know css blocks will remove unused css - this is awesome so your utility classes can be there if you need them, but don't cause un-necessary bloat.

However, if you are refactoring large amounts of css, it seems to me we'd also be interested in removing the code from the codebase altogether. The best solution in my eyes would be an editor/ide extension that highlights unused/dead css, along with a linter that can help you clean up the whole codebase or evaluate its cleanliness.

Will this eventually be something that's included in the css-blocks experience?

devinrhode2 avatar May 06 '19 15:05 devinrhode2

@devinrhode2 Absolutely. Presently dead code removal is a feature of opticss, but it falls out of the analysis results pretty easily. I'd love to see this capability added as a generalized API that can plug into the results of a build that outputs a report/json data/etc, or be ran from the css blocks cli.

chriseppstein avatar Jul 17 '19 22:07 chriseppstein

@jackson-dean does something like this fall out of the "find all references" work you're doing?

chriseppstein avatar Nov 25 '19 21:11 chriseppstein

@chriseppstein I think it’s related to having the analyzer gathering information that we can expose to the editor. So I think they’re different things, but will probably be made possible it. I’m curious to see how expensive it would be to gather this information. I can imagine something that gives you file names and line numbers in vscode to fix interactively or even a fully automated “clean up the world“ type of thing. Still nascent stages though 🙂

jackson-dean avatar Nov 26 '19 15:11 jackson-dean