Skip to content

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

Open
@juanporley

Description

@juanporley

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions