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] tailwindcss/enforces-shorthand try to shorthand 'inset-y-0' with a whitespace #312

Closed
Senbonzakura1234 opened this issue Jan 22, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Senbonzakura1234
Copy link

Senbonzakura1234 commented Jan 22, 2024

Describe the bug
The rule try to shorthand 'inset-y-0' with a whitespace before an appending template string variable

To Reproduce
Steps to reproduce the behavior:

try typing this JSX:
<div className={`absolute inset-y-0 left-0 w-1/3 rounded-[inherit] shadow-lg ${className}`} />
got lint warning Classnames '' could be replaced by the 'inset-y-0' shorthand! eslint (tailwindcss/enforces-shorthand)
format the code and it change to:
<div className={`absolute inset-y-0 left-0 w-1/3 rounded-[inherit] shadow-lg${className}`} />

Expected behavior
Expect it not to remove the whitespace, no lint warning
<div className={`absolute inset-y-0 left-0 w-1/3 rounded-[inherit] shadow-lg ${className}`} />

Screenshots
image

Environment (please complete the following information):

eslint config file or live demo
https://github.com/Senbonzakura1234/sophie-dex

@Senbonzakura1234 Senbonzakura1234 added the bug Something isn't working label Jan 22, 2024
@francoismassart
Copy link
Owner

👋 @Senbonzakura1234
can you try the latest beta by running

npm i [email protected] -D ?

And then try to reproduce the issue ? I added a test case which runs fine.

Thank you for your feedback

@Senbonzakura1234
Copy link
Author

[email protected] -D

Okay so it seems the beta version works

@francoismassart
Copy link
Owner

Fixed in 3.14.1

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

2 participants