css-modules / postcss-icss-values

Pass arbitrary constants between your module files
MIT License
203 stars 18 forks source link

no-unused-import plugin? #111

Closed EcutDavid closed 5 years ago

EcutDavid commented 6 years ago

Hey,

I didn't find any clue that this postcss plugin already exist, but do we have some thing that will yield an error or warning for

----content of a.css----
@value b from "b";

@value c from "c";

.d {
    color: b;
}
----end of a.css----
a.css
3:1:  Imported values must be used (no-unused-import): c

Thanks!

kumarharsh commented 6 years ago

Even I'd like to see this implemented. Although I get a feeling it's not possible because literally any file can import any variables from any other file without any explicit export statement. Hence the linter would need to analyse the whole codebase to give any unused import error.

EcutDavid commented 5 years ago

Agree with what @kumarharsh said.