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] enforces-shorthand misbehaves with false-positive on non-redundant rounded classes #327

Open
Aleuck opened this issue Mar 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Aleuck
Copy link

Aleuck commented Mar 15, 2024

Describe the bug
enforces-shorthand rule gets confused with different rounded classes, suggesting fixes that are not equivalent to original code.

To Reproduce
Steps to reproduce the behavior:

  1. Create a div with classes rounded-b-xl and rounded-tr-xl (rounded bottom and top-right);
  2. Run eslint with eslint-plugin-tailwindcss with recommended settings;
  3. Get warning

    Classnames 'rounded-tr-xl' could be replaced by the 'rounded-r-xl' shorthand! eslint(tailwindcss/enforces-shorthand)

  4. Run with eslint --fix;
  5. Eslint replaces both classes (rounded-b-xl and rounded-tr-xl) with rounded-r-xl only.

Expected behavior
No warning should be shown and no fix should be made as both classes are not redundant.

Environment (please complete the following information):

  • OS: macOS 14.3.1
  • Softwares + version used:
    • VSCode 1.87.1
    • yarn 1.22.19
    • node v16.20.2
@Aleuck Aleuck added the bug Something isn't working label Mar 15, 2024
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

1 participant