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

Support composition #8

Closed jaydenseric closed 3 years ago

jaydenseric commented 4 years ago

At the moment, the composes: syntax for composition is not supported in 2 ways:

  1. Falsely reports composes: classes as unused. Possibly related to https://github.com/bmatcuk/eslint-plugin-postcss-modules/issues/7 ?
  2. The composes: className from './file.css' syntax to import specific classes for composition (see the CSS Modules “Composing from other files” docs).
jaydenseric commented 4 years ago

Perhaps postcss-modules-extract-imports is part of the solution?

bmatcuk commented 3 years ago

Hey @jaydenseric, sorry it's taken so long for me to get to this... been a very busy month for me! Haven't forgotten about these tickets, though!

I've just pushed some changes to the repo that I think will solve the problems with composes. Could you give it a try? I haven't officially released via npm yet so you'll need to use the github syntax in your package.json, ie:

{
  "devDependencies": {
    "eslint-plugin-postcss-modules": "bmatcuk/eslint-plugin-postcss-modules"
  }
}
bmatcuk commented 3 years ago

I assume all is well with composition, too? I'm going to close this issue, but let me know if you run into trouble!