stylelint-no-unused-selectors icon indicating copy to clipboard operation
stylelint-no-unused-selectors copied to clipboard

Impossible to check .module.css files

Open Aliaksei-Martsinkevich opened this issue 5 years ago • 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)

Aliaksei-Martsinkevich avatar Sep 24 '19 09:09 Aliaksei-Martsinkevich

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

nodaguti avatar Sep 24 '19 09:09 nodaguti

Is there any movement on this issue?

ivkirill avatar Oct 21 '20 11:10 ivkirill

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.

jklmli avatar Jan 17 '22 23:01 jklmli

Friendly ping @nodaguti.

kutsan avatar Jun 12 '22 18:06 kutsan

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.

tnagorra avatar May 17 '23 13:05 tnagorra

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

wawezz avatar Nov 27 '23 12:11 wawezz