A CLI tool to find unused CSS modules selectors in a project.
cssmdoc <dir> [options]
-i, --ignore <paths...>: Comma-separated paths to ignore. This can be directories or specific CSS files.--styleGlobs <globs...>: Glob patterns to find CSS module files. (default:".css")--exts <exts...>: Component file extensions to check. (default:"jsx","tsx")-r, --reverse: Enable reverse mode to find selectors used in components but not defined in CSS files.-o, --output <path>: Write report output to file instead of stdout.--outputFormat <format>: Output format:cli,json, ormd.- Default:
cli - If omitted and
--outputends with.jsonor.md, format is inferred from extension.
- Default:
To find all unused CSS module selectors in the test_project directory:
cssmdoc ./test_projectTo find selectors that are used in your components but don't exist in the corresponding CSS files:
cssmdoc ./test_project -rcssmdoc ./test_project --output report.jsoncssmdoc ./test_project --output report.mdcssmdoc ./test_project --output report.txt --outputFormat mdTo analyze a project with .js files and ignore the dist folder:
cssmdoc ./my-project --exts js --ignore dist