Skip to content
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] Using arbitrary values like *-[color]/alpha in the class name causes an error in the "tailwindcss/no-custom-classname" rule #130

Closed
taigakiyokawa opened this issue Mar 7, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@taigakiyokawa
Copy link

Describe the bug
I add the class bg-[#ccc]/75 and get an error:
image

Expected behavior
There should be no error.
If I add the class like bg-[#ccc]/[75%] then get no error, but the class like bg-[#ccc]/75 should also work correctly.

Environment (please complete the following information):

  • OS: macOS 12.2.1
  • Softwares + version used:
    • VSCode 1.64.0
    • eslint-plugin-tailwindcss 3.5.0
    • tailwindcss 3.0.23
    • npm 8.1.0
    • node v16.13.0

eslint config file or live demo
https://play.tailwindcss.com/fezYYq7F1Z

@asharonbaltazar
Copy link

Hey, loving your lib. Just jumping on this issue to say that this an issue with stroke-[val] as well.

Screen Shot 2022-04-26 at 2 23 04 PM

@francoismassart
Copy link
Owner

I just published a beta version with the fixes listed on #132
https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/fix/no-custom-classname-plugin-support#readme

npm i eslint-plugin-tailwindcss@3.6.0-beta.0

Please give it a try and provide feedback and or issues 👍
Thank you

@francoismassart
Copy link
Owner

@taigakiyokawa & @asharonbaltazar can you

npm i eslint-plugin-tailwindcss@3.6.0-beta.1 and confirm it fixes your issues ?

Thanks

@asharonbaltazar
Copy link

Hey @francoismassart, I'll give it a shot later today.

@taigakiyokawa
Copy link
Author

@francoismassart Sorry for late reply. I also try it later today.

@taigakiyokawa
Copy link
Author

taigakiyokawa commented Jun 28, 2022

@francoismassart
quick note: I checked bg-[#ccc]/[75] is working but similar cases such as border-t-[#000]/[5] doesn’t working yet.

@francoismassart
Copy link
Owner

@taigakiyokawa strange, I edited the dedicated unit test and it passed:

See bdc4bbd

@francoismassart
Copy link
Owner

@taigakiyokawa maybe you should make sur to restart Visual Studio Code after installing the latest beta.
Sometimes it is required in order to get it updated.

@asharonbaltazar
Copy link

asharonbaltazar commented Jun 28, 2022

@francoismassart Can confirm, after a VS Code restart, that stroke-[4] is working for me! Anything else you want me to test?

@francoismassart
Copy link
Owner

Should be fixed in the latest release 3.6.0

Make sure to:

  1. Update the eslint-plugin-tailwindcss package
  2. Restart your editor
  3. Report any issue on this repo

@asharonbaltazar
Copy link

My one complaint is that it's a bit annoying to npm run lint --fix every time we upgrade. Otherwise, appreciate the hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants