bmatcuk / eslint-plugin-postcss-modules

Checks that you are using the classes exported by your css modules using postcss.
MIT License
21 stars 7 forks source link

Doesn't detect unused classes #12

Closed Dema closed 3 years ago

Dema commented 3 years ago

Here is the repo https://github.com/Dema/eslint-postcss-modules-bug If you try to open vscode it won't complain about unused class. But if you uncomment css-modules plugin, it'll start complaining.

bmatcuk commented 3 years ago

Sorry it took me forever to get to this - turns out the issue is that, somewhere along the way, eslint changed the way it merges configs together. Their new method of merging mangles regexes. Unfortunately, this means that it's not possible to use a regex for the include and exclude settings. You can use a string with globs (including **).

I've updated the README and cut a new version that uses "**/*.css" as the default for include and "**/node_modules/**/*" as a default for exclude.