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

Ability to mark class as used?

Open imathews opened this issue 5 years ago • 0 comments

First off, thank you so much for this library! This is exactly what our team was looking for, and it plays perfectly with our postcss setup.

We are experiencing a few instances of false-positives, where a class is used but it's alerted as unused. Specifically, this happens when utilize the value of a variable to reference a class (e.g., <button className={styles[buttonType]} />)

I wouldn't expect the linter to handle this case, but it would be great to be able to ignore linting errors in these circumstances. The eslint-plugin-css-modules package implements the ability to do this, but it doesn't seem that postcss-modules supports a similar concept to their markAsUsed option.

imathews avatar Mar 06 '21 00:03 imathews