francoismassart / eslint-plugin-tailwindcss

ESLint plugin for Tailwind CSS usage
https://www.npmjs.com/package/eslint-plugin-tailwindcss
MIT License
1.5k stars 71 forks source link

[BUG] class detection on WebComponent ? #374

Open neviaumi opened 2 hours ago

neviaumi commented 2 hours ago

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):

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 commented 2 hours ago

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