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
[BUG] Support of Vue v-bind:class #168
Comments
This is a shame because https://tailwindcss.com/blog/automatic-class-sorting-with-prettier does sort classes in |
Would be awesome. I tried with the existing options but couldn't manage to find a regex that could work. |
@extrem7, @kevinvalk, @innocenzi, @NielsJanssen, @hrubysi Are you willing to test it out and give feedback using real/complex projects once it is available in the beta channel ? |
Awesome! I would love to. |
Here is a first beta for the
👉 Make sure the I made an invalid test in https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/feat/v-bind/tests/lib/rules/wip.js#L71, take a look at it if you want to know what to expect in terms of usage. Thank you for your feedback(s) |
FYI: I don't think I'll go as far as checking the value of a An easy fix for this is using a We use this same logic in our react project when we pass props meant to contain Tailwind CSS classnames (which are not named e.g. ...
<Transition
as={Fragment}
enter={ctl('transition duration-100 ease-out')}
enterFrom={ctl('scale-95 opacity-0')}
enterTo={ctl('scale-100 opacity-100')}
leave={ctl('transition duration-75 ease-in')}
leaveFrom={ctl('scale-100 opacity-100')}
leaveTo={ctl('scale-95 opacity-0')}
>
... |
The entire underlining is normal, it could be enhanced for sure but it disappears quickly especially if the error is fixable automatically by the plugin. As stated in my previous comment, for now only the no-custom-classname is supported but more rules will be published in beta channel soon and I’ll post it in this issue. |
Awesome! Thanks for your work. Looking forward to the sorting. ❤️ |
Here is a new beta version with all the rules available for v-bind 👉 Keep in mind that arrays and objects passed to a The plugin won't lint array elements "amongst themselves": I'll keep it in beta for few days at least, please test it out. Thank you for the feedback. |
@innocenzi 👇 should do the trick 🎉 |
Can confirm, does the trick 🎉 Not sure how hard it would be to implement, but it would be great if However, I'm really happy with what's currently in |
It seems to work well for me. |
@francoismassart I found a bug while using Error:
Triggering code:
|
@hrubysi thank you, I’ll fix this and publish a new beta |
@hrubysi 👉 |
* chore: add wip v-bind tests for no-custom-classname * chore: first beta tests for v-bind * 3.9.0-beta.0 * refactor(no-custom-classname): templateVisitor * tests(no-custom-classname): v-bind * feat(no-contradicting-classname): v-bind * feat(no-arbitrary-value): v-bind * feat(migration-from-tailwind-2): v-bind * feat(enforces-shorthand): v-bind * feat(enforces-negative-arbitrary-values): v-bind * feat(classnames-order): v-bind * chore: cleaning temp code * 3.9.0-beta.1 * fix: #168 (comment) * 3.9.0-beta.2 * fix: property of null * 3.9.0-beta.3
Seems like the plugin doesn't work with Vue
v-bind:class
functionality.The text was updated successfully, but these errors were encountered: