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

Falsely reports animation keyframes as unused classes #7

Closed jaydenseric closed 3 years ago

jaydenseric commented 4 years ago

If a CSS module has animation keyframes named for example fadeIn, and in the same module the keyframes are used via animation-name: fadeIn;, the postcss-modules/no-unused-class rule incorrectly reports the keyframes name as an unused class:

Screen Shot 2020-06-26 at 10 56 22 am
bmatcuk commented 4 years ago

Ah, that's because it's not checking if classes and such are used in the CSS module. I'll see if I can fix this over the weekend. Thanks for the bug report!

bmatcuk commented 3 years ago

Sorry again that's I've been so slow to get to these! I haven't looked into this issue specifically yet, but I'm pretty sure it'll be the easiest of the three to solve. I know exactly what I need to do - should only be, like, a dozen lines of code at most. Should have some time this weekend.

Thanks for being patient! Sorry to keep you waiting!

jaydenseric commented 3 years ago

Thanks for your hard work! Once all of these related issues are fixed we can test it in our codebase :)

bmatcuk commented 3 years ago

Alright, @jaydenseric, I think I've got keyframes working correctly! And with that, I've got fixes for all of the open issues. Could you give it a try, using the master branch? I want to make sure all the changes don't cause other bugs before I cut an official npm release.

package.json:

{
  "devDependencies": {
    "eslint-plugin-postcss-modules": "bmatcuk/eslint-plugin-postcss-modules"
  }
}

Thanks!

jaydenseric commented 3 years ago

I'll give it a try now…

jaydenseric commented 3 years ago

Well done! It seems to work ok, it's picking up some legit problems in our codebase.

bmatcuk commented 3 years ago

Awesome! I've officially published v1.2.0 to npm so you can update your package.json. Lemme know if you find any other issues.