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] class detection on WebComponent ? #374

Open
neviaumi opened this issue Nov 1, 2024 · 1 comment
Open

[BUG] class detection on WebComponent ? #374

neviaumi opened this issue Nov 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@neviaumi
Copy link

neviaumi commented Nov 1, 2024

Describe the bug
Reporduce repo
I am working custom element in plain JS project, and when i assign style to the html tag though class attributes, seem the checking was disabled.

To Reproduce
Steps to reproduce the behavior:

  1. Go the repo provided
  2. run npm install && npx eslint .

Expected behavior
tailwindcss/no-custom-classname should be trigger

Screenshots

connectedCallback() {
        const template = document.createElement('template');
        template.innerHTML = `
<link rel="stylesheet" href="${mainCss}">
<main class="page">
    <section class="${clsx("xyz")}">
    Use clsx wrapper the class naem to trigger eslint
</section>
    <section class="page-content">
       Useing wrong class names without error
    </section>
</main>`;
        this.shadowRoot.appendChild(template.content.cloneNode(true));
    }

Only the class wrapped in clsx has been checked.

Environment (please complete the following information):

  • OS: Mac
  • Softwares + version used:
    • Node 20
    • eslint-plugin-tailwindcss 3.17.5
    • eslint 9.13.0

Additional context
Add any other context about the problem here.

eslint config file or live demo
By providing a link to a live demo, a demo video or a github repo fixing the issue will be easier.

@neviaumi neviaumi added the bug Something isn't working label Nov 1, 2024
@neviaumi
Copy link
Author

neviaumi commented Nov 1, 2024

I am happy to warp my class with clsx as temp solution, but seem it was unexpected behaviour for me

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

1 participant