-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work with CSS-modules #3
Comments
What is the expected behavior in this case? ( Not sure from the comment in your repo ) You mean |
It is actually prevented here → https://github.com/fsubal/eslint-plugin-classnames/blob/main/lib/rules/prefer-classnames-function.js#L95-L115 Dropping className={classNames({ a: true })}
className={{ a: true }} // This is wrong, of course
className={classNames(foo ? 'a' : 'b')}
className={foo ? 'a' : 'b'} // This can be acceptable, but not expected? Maybe you can add some cases for specially allowing single argument with |
Took a look at this today @fsubal, and ended up realizing exactly what you wrote here; that it's problematic without a literal string value. I guess you would need to use
into
But that's a significantly bigger task, and should be its own rule as type-aware linting performs slower. |
Here's repro:
https://github.com/akhdefault/eslint-classnames-repro/blob/main/pages/index.js#L10
The text was updated successfully, but these errors were encountered: