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] Prefix from tailwind.config.js not working with named groups #243

Closed
bezbac opened this issue May 25, 2023 · 1 comment · Fixed by #244
Closed

[BUG] Prefix from tailwind.config.js not working with named groups #243

bezbac opened this issue May 25, 2023 · 1 comment · Fixed by #244
Labels
bug Something isn't working

Comments

@bezbac
Copy link
Contributor

bezbac commented May 25, 2023

Describe the bug
A colleague of mine discovered this issue. We use the ESlint plugin at work and have a shared component library using a tailwind with a prefix to avoid collisions with other tailwind projects. While developing a new feature, we wanted to use the recently introduced syntax for named groups, but ESlint kept nagging about a non-existent class.
I looked into the code for no-custom-classname, and the regex responsible doesn't include the prefix from the tailwind config. I believe this is the issue.

To Reproduce

// HTML
<div class="tw-group/edit">
  <div class="group-hover/edit:tw-text-red-500">Some content</div>
</div>


// tailwind.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
  prefix: "tw-"
}

The plugin will report a false positive unknown class name tw-group/edit and group-hover/edit:tw-text-red-500

Expected behavior
Support the specified prefix specified inside the tailwind.config.js together with the named groups and peer syntax.

@bezbac bezbac added the bug Something isn't working label May 25, 2023
@francoismassart
Copy link
Owner

Available for testing and feeback via npm i eslint-plugin-tailwindcss@3.12.1-beta.0

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

Successfully merging a pull request may close this issue.

2 participants