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

[Feature request] Lint values in a object #135

Closed
arekbartnik opened this issue Apr 8, 2022 · 5 comments · Fixed by #185
Closed

[Feature request] Lint values in a object #135

arekbartnik opened this issue Apr 8, 2022 · 5 comments · Fixed by #185
Labels
enhancement New feature or request

Comments

@arekbartnik
Copy link

Is your feature request related to a problem? Please describe.
Can't lint values in an object passed to a callee.

My list of callees: ["clsx", "cva"].

This doesn't work:

const buttons = cva({
  variants: {
    variant: {
      primary: "bg-white text-black font-bold px-4",
      secondary: "bg-black text-white font-semibold px-5",
    },
  },
});

This does:

const buttons = cva({
  variants: {
    variant: {
      primary: clsx("bg-white text-black font-bold px-4"),
      secondary: clsx("bg-black text-white font-semibold px-5"),
    },
  },
});

Describe the solution you'd like
I would like for the first example to work.

@arekbartnik arekbartnik added the enhancement New feature or request label Apr 8, 2022
@robotkutya
Copy link

any progress with this?

this would be awesome!

@francoismassart
Copy link
Owner

The MR #185 does not fix this specific issue

@dipsaus9
Copy link
Contributor

@francoismassart It looks like bg-white and bg-red are no contradicting classes in the test setup. This is no different then
classNames or classes.

So linting in a object should be closed, a new issue should be opened for linting contradicting classes for background in tailwind.

@dipsaus9
Copy link
Contributor

Found the issue in the example
bg-red is not a valid Tailwind class. This should be a gradient of red, for example red-50. If added red-50 eslint will give you an error.

francoismassart added a commit that referenced this issue Dec 29, 2022
@francoismassart
Copy link
Owner

Fixed in the latest release v3.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants