temoncher / eslint-plugin-clsx

ESLint plugin for clsx/classnames
MIT License
8 stars 1 forks source link

`no-redundant-clsx` does not work with backtick strings (template literals) #7

Closed YayC closed 1 week ago

YayC commented 1 month ago

The no-redundant-clsx rule fails to report className=clsx(`foo`). It is correctly detected after changing it to className=clsx('foo').

I think backtick strings also break other rules, but I haven't tested extensively.

YayC commented 1 month ago

I created a PR with a basic fix. Let me know if it looks ok, it definitely needs to be tested more as I haven't written eslint rules before. My quick test for className={clsx(`foo`)} worked

temoncher commented 2 weeks ago

I merged the PR, but for some reason now ESLint fails on build.

I won't have access to a computer for a couple of weeks. In case you need this feature now you can make another PR with ESLint issue fix and package.json minor version increment. After we merge that - release PR should be created automatically.

YayC commented 2 weeks ago

thanks for merging that in! sounds good, I can try to take a closer look later this week or next

temoncher commented 1 week ago

@YayC v0.0.4 with fix is released on npm

It would be cool to generate v0.0.4 entry into CHANGELOG.md with changesets cli https://github.com/changesets/changesets/blob/main/packages/cli/README.md. You can make a PR if you are interested, otherwise I will be able to do it in a week or so.

temoncher commented 1 week ago

Added 0.0.4 to CHANGELOG.md