-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
[Feature request] cjs config extension support #190
Comments
This would be marvelous. It took me some time to understand why the plugin would report false positives after migrating to // This mixin applies some additional checks for projects using Tailwind.
module.exports = {
plugins: [
// Plugin documentation: https://www.npmjs.com/package/eslint-plugin-tailwindcss
'eslint-plugin-tailwindcss'
],
overrides: [
{
// Declare an override that applies to TypeScript files only
files: ['*.ts', '*.tsx'],
rules: {
'tailwindcss/classnames-order': ['warn', { config: 'tailwind.config.cjs' }],
'tailwindcss/enforces-negative-arbitrary-values': 'warn',
'tailwindcss/enforces-shorthand': 'warn',
'tailwindcss/migration-from-tailwind-2': 'warn',
'tailwindcss/no-arbitrary-value': 'off',
'tailwindcss/no-custom-classname': ['warn', { config: 'tailwind.config.cjs' }],
'tailwindcss/no-contradicting-classname': 'error'
}
}
]
}; |
You can actually specify your config file in the top level Example .eslintrc: {
"extends": ["plugin:tailwindcss/recommended"],
"settings": {
"tailwindcss": {
"config": "./tailwind.config.cjs"
}
},
"rules": {
// Other options here
}
} |
@taep96 & @ChristianIvicevic |
Afaik .cjs is only used when ESM/TS can't be so this issue isn't valid anymore unless I'm missing something. |
In projects that have
"type": "module"
set inpackage.json
, you have to usetailwind.config.cjs
instead oftailwind.config.js
, since TainwindCSS config doesn't support ES modules. Can you also check for.cjs
config files by default, so there is no need to set the option?The text was updated successfully, but these errors were encountered: