Skip to content

[BUG] Using no-custom-classname with DaisyUI #129

@oscartbeaumont

Description

@oscartbeaumont

Describe the bug
I am using TailwindCSS with the DaisyUI plugin and am having issues with the no-custom-classname rule. This plugin will report DaisyUI's classes as a custom classname and create an eslint warning.

To Reproduce
Steps to reproduce the behavior:

  1. Go to here
  2. Run yarn lint in terminal.
  3. Observe:
/home/projects/vitejs-vite-spjry7/src/main.tsx
  7:9   warning  Classname 'not-valid' is not a Tailwind CSS class!  tailwindcss/no-custom-classname # This one is expected
  8:13  warning  Classname 'btn' is not a Tailwind CSS class!        tailwindcss/no-custom-classname # This is a DaisyUI class and shouldn't cause a warning

Expected behavior
Classes from TailwindCSS plugins such as DaisyUI should not be reported by tailwindcss/no-custom-classname as a custom classname. This seems like a reasonable behaviour as this eslint plugin has access to the Tailwind configuration.

Hence in the example repository, there should end up being only one eslint error for the class not-valid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions