Open mafikes opened 1 year ago
I fix this issue with adding cssFiles strictly to the no-custom-classname rule.
It was working fine before update.
// .eslintrc.js
"tailwindcss/no-custom-classname": ["warn", {
cssFiles: [
"resources/css/app.css",
"resources/css/editor.css",
"resources/css/font-delivery.css"
]
}],
Hi @mafikes Can you share a demo repo so that I can take a look at it ?
Happening to me too
It happened to me too. But I can fix that.
In my case I use .scss
and it has the code comment start with // some comment
(double slash),
when I remove It or replace it with /* some comment */
and rerun eslint,
it's back to work.
in my main.scss
file
❌Bad
// components
@import "./components/button";
✅ Good
/** components */
@import "./components/button";
It happened to me too.
Got the same error but I want to enable custom classes so I just disabled the error:
"tailwindcss/no-custom-classname": "off"
No clue why, but simply having the cssFiles parameter present fixed it for me. The problem seemed to start after switching to the flat config. This works and is still checking the tsx files.
...compat.config({
plugins: ["eslint-plugin-tailwindcss"],
extends: ["plugin:tailwindcss/recommended"],
rules: {
"tailwindcss/classnames-order": "off",
"tailwindcss/no-custom-classname": [
"warn",
{
callees: ["twMerge"],
cssFiles: [],
},
],
},
}),
Describe the bug I updated eslint-plugin-tailwindcss to the latest version and getting error below:
To disable no-custom-classname without change or help. I need to disable all plugin to finish my build process.
To Reproduce npm run lint
Environment:
eslint config file I use default eslint setup from tailwindcss as "warn"