-
-
Notifications
You must be signed in to change notification settings - Fork 69
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] no-custom-classname rule will not honor the project setting for config #212
Comments
I believe this may be happening with all rules as I'm experiencing the same with both |
Can you try to provide the path to the // .eslintrc.js
const path = require("path");
...
"settings": {
"tailwindcss": {
"config": path.join(__dirname, "custom-file"),
}
} |
I did try but it doesn't work. Regardless of what I pass in the project setting, the rule config's default shadows the project config. |
Please provide a demo repository and I'll investigate more 😉 |
Thanks @francoismassart . I created a sample repository here: https://github.com/davazp/eslint-plugin-tailwindcss-issue-212 You can reproduce it by npm installing it and running I made a custom file for tailwind config at const path = require('path');
module.exports = {
plugins: ["tailwindcss"],
parser: '@typescript-eslint/parser',
rules: {
// If we remove the {} options here, it will work. With it, the
// default for the rule takes over project setting.
"tailwindcss/no-custom-classname": ["error", {}]
},
settings: {
tailwindcss: {
config: path.join(__dirname, 'tailwindcss.custom.js')
}
}
}; I specify the config. However, the plugin will still think I hope this helps! Let me know if I can do anything else. |
@francoismassart I too have tried providing the path to the config file via an absolute path without any luck. |
That is caused by the default value set in the |
@davazp & @isaaccuraErnesto Waiting for your feedback(s) 😉 |
The upgrade fixes it for me! Thanks for the work. |
👉 |
@francoismassart I'm working in a mono-repository having a top To test I added the following: "tailwindcss/no-custom-classname": ["off", {
"config": "ciao",
"cssFiles": ["src/*.css", "src/**/*.css"]
}]
Any advice? I tried to move every dependency in both folder's package.json with no luck. |
@damianobarbati please, have you ever resolved it or maybe opened a new issue? |
* add ghost api * connect blog overview page * connect and render post detail * add processing to server * update blog detail page * add eslint-plugin-tailwindcss * add @tanstack/react-query * truncate text by numberOfLines * use ComponentPropsWithRef to infer style prop type * update ghost fns * update index * add tag page * add author page * update / * update /tag * update /author * update detail page * fix posts type * disable redirect * remove global background - not found pages - pages without common layout (preview) * tmp: hide nav on smaller screens * update app layout spacing * remove text truncating * update / spacing and sizing * update .vscode/settings.json * update .eslintrc * update prettier-plugin-tailwindcss * sort tailwind classes * add packages/eslint-config-custom * use turbo lint * use tailwind.config.cjs see francoismassart/eslint-plugin-tailwindcss#212 * reset global line-height * fix lint-staged * update color tokens * update spacing and sizes * Update apps/website/src/lib/ghost.ts Co-authored-by: Pavel <14926950+prichodko@users.noreply.github.com> * update layout max width * update card min width * set line-height * set overflow on pre * use flex for markdown content to prevent overflow * collect follow-ups * add visibility filter * update page count * rename var * remove filter * use prod ghost api key * update ghost api * revert line-height * add limit to getPosts params * update visible posts * add related articles * add env vars to gh * rename eslint config package * update gh vars * rename envs * set emtpy array to related posts * fix lint-staged * prevent importing server envs on client * set limit --------- Co-authored-by: Felicio Mununga <felicio@users.noreply.github.com>
Describe the bug
When I add a project setting like described in the README:
to specify the tailwind config file (in .eslintrc), the
no-custom-classname
will ignore it.I can workaround the issue by specifying the rule specific config:
I debugged a little bit and it seems the options of the rule have a default defined.
I think that default shadows the project setting:
eslint-plugin-tailwindcss/lib/util/settings.js
Lines 5 to 12 in be3a826
eslint config file or live demo
Let me know if you need further information, I can work to provide one.
The text was updated successfully, but these errors were encountered: