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/classnames-order, className={relative w-full overflow-hidden ${(className)}} not working. #131

Closed
demonguyj opened this issue Mar 10, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@demonguyj
Copy link

className={relative w-full overflow-hidden ${(className)}}

is not linting.

Expected behavior
className={overflow-hidden relative w-full ${className}}

Environment (please complete the following information):

OS: windows10
Softwares + version used:
VSCode 1.65.1
eslint-plugin-tailwindcss 3.5.0
tailwindcss 3.0.23
npm 7.23.0
node v14.17.6

@francoismassart
Copy link
Owner

@demonguyj are you expecting that this input:

className={`overflow-hidden relative w-full ${(className)}`}

becomes

className={`overflow-hidden relative w-full ${className}`}

after linting ?

I made an isolated test (without the parentheses) like so:

https://github.com/francoismassart/eslint-plugin-tailwindcss/pull/132/files#diff-57cc0aaec7751e5830fd721783391b306e25da9e6f57e56d2cd6d17bcd4d024fR257

    {
      code: `
      <div className={\`overflow-hidden relative w-full ${"className"}\`}>Issue #131</div>
      `,
    },

and it passes.

Can you give me more infos about your issue ?

@demonguyj
Copy link
Author

demonguyj commented Mar 12, 2022

Hello 👋

I hope sorting classes.

Input:

  1. className={relative w-full overflow-hidden ${className}}
  2. className={test ${(open === false) ? relative invisible overflow-hidden : ``}}

Now(same like Input):

  1. className={relative w-full overflow-hidden ${className}}
  2. className={test ${(open === false) ? relative invisible overflow-hidden : ``}}

Expect:

  1. className={overflow-hidden relative w-full ${className}}
  2. className={test ${(open === false) ? invisible relative overflow-hidden : ``}}

@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

@demonguyj
Copy link
Author

Thanks for your feedback. :)
I tested 3.6.0-beta.0.
But not yet fixed... :(
I explained test case.
It will be help for your works.
Thx!

  1. Input case1
    image
    -> Expected result.

  2. Input case2
    image
    -> Not showing warning.

2-1) Expected
image
-> w-full, h-full position is switched.

@francoismassart
Copy link
Owner

The issue is caused by the fact that the plugin only support litteral value for now but I made a patch for this, it will be available in the next beta

@francoismassart
Copy link
Owner

@demonguyj please try using this beta version:

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

It should work for you

@demonguyj
Copy link
Author

@francoismassart It's works well :)
Thanks!

@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

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