eslint-plugin-css-modules icon indicating copy to clipboard operation
eslint-plugin-css-modules copied to clipboard

no-undef-class dismisses classes within :global(.class) {

Open juanporley opened this issue 8 months ago • 0 comments

For "css-modules/no-undef-class" I'm facing an issue similar to others that have been fixed in the past. Sometimes css module classes can be namespaced with globals as such:

:global(.some-class) {
    .accept {
        color: green;
    }

    .reject {
        color: red;
    }
}

Both accept and reject are valid classes, however the plugin drops them and they show up as errors in my repo: 46:65 error Class or exported property 'accept' not found css-modules/no-undef-class

I think it should be possible to disregard the global wrapper but still evaluate its contents to find valid classes within it.

Environment

I'm running:

  • eslint 7.32.0
  • eslint-plugin-css-modules 2.12.0
  • sass 1.75.0
  • node 18.16.1

juanporley avatar Jun 07 '24 14:06 juanporley