nodaguti/stylelint-no-unused-selectors

Impossible to check .module.css files

Opened this issue · 6 comments

I have all css modules files names as following: *.module.css (i.e. Button.module.css) with corresponding tsx file *.tsx (i.e. Button.tsx). And using current template capabilities, I cannot match these files, because cssName equals to Button.module in this case.

I suggest to provide ability to specify resolver as custom function type DocumentPathResolver = (cssFilePath: string) => string | null, which would return path to a document.
(i.e. it should be possible to provide such function via option resolve.documents)

Thank you for your suggestion! That would add extra flexibility and must be useful. I'll work on this this weekend.

Is there any movement on this issue?

Please add support for this! Next.js comes built in with CSS modules in files of the form *.module.css, and adding support for this would open it up to that audience.

Friendly ping @nodaguti.

A quick an easy way to solve this would be a list of suffix that can be removed from the css filename, so that it can be compared with the js files.

Will you make solution for *.module.css files?