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] Add new rule for whitelisting only specific Tailwind classes #362

Open
effektsvk opened this issue Oct 2, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@effektsvk
Copy link

Is your feature request related to a problem? Please describe.
I'm working on a project where I'm using Tailwind CSS, and I'd like to enforce a rule that limits the use of only specific Tailwind utility classes across the codebase. It would be beneficial to whitelist certain classes to ensure consistency and avoid the accidental use of unapproved or unnecessary classes. I often find it frustrating to track down and prevent classes that deviate from the design system or approved styles.

Describe the solution you'd like
I would like to see a new ESLint rule introduced that allows us to configure a whitelist of Tailwind classes that are permitted in the project. The rule would throw an error or warning if any non-whitelisted Tailwind class is used. This would help maintain consistency and enforce a strict design system by ensuring only approved Tailwind classes are used.

Describe alternatives you've considered
I’ve considered manual code reviews to spot and remove unapproved Tailwind classes, but this is time-consuming and prone to errors.

Additional context
I've implemented it by copying no-custom-classname and slightly adjusting the logic, I can prepare a PR if you would be interested.

@effektsvk effektsvk added the enhancement New feature or request label Oct 2, 2024
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
Development

No branches or pull requests

1 participant