Add CLI command to check for undefined classnames#223
Add CLI command to check for undefined classnames#223
Conversation
|
This is a :neat: idea. It probably, though, should end up in an ESLint module or should use a similar method of extracting the data using AST (both for LESS and JS). Though, for now, it might just be nice to run it occasionally as-is. I worry though that it could get confused with |
|
An AST is better, but since this is crossing between both project-wide js/ts and project-wide css/less, if it were solely an eslint rule or a csslint rule, I could realistically imagine a notable processing time , along with a handful of new dependencies. Eg. in eslint, scanning/parsing all css/less files would happen for each js file). It's difficult since it covers strange ground. For something cross-filetype like this, conceptually it might make sense as a webpack plugin at build-time (though still would have some dev hurdles in AST form there), however the usecase for this tools is currently internally prior to framework releases (like a pseudo unit-test), not in build. So a standalone command, or possibly an internal unittest pre-run function might be ideal; open to ideas. |
There are undefined and global classname leaks when classnames, that are not defined in the component less modules, are used or referenced within components.
Add a private command that identifies these potential unintentional global or undefined classes.
Only works on the root package directories, but not within component directories.
TODO: Check for default classes
Enact-DCO-1.0-Signed-off-by: Teck Liew (teck.liew@lge.com)