Open Binero opened 1 year ago
@Binero I guess you defined the custom class shadow-15-60
in your tw config ? as well as an additional max-lg
entry in screens
I did, as well as many others. It doesn't recognise any of them.
Snippet, for brevity:
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
theme: {
extend: {
spacing: {
'34': '8.75rem',
'84': '21rem',
},
dropShadow: {
'15-100': '0 0 15px rgba(0, 0, 0, 1)',
'10-100': '0 0 10px rgba(0, 0, 0, 1)',
'05-60': '2px 2px 0.5px rgba(0, 0, 0, 0.6)',
'05-100': '5px 5px 10px rgba(0, 0, 0, 0.4)',
},
boxShadow: {
'15-60': '0 5px 10px rgba(0, 0, 0, 0.4)',
'vignette': 'inset 0px 0px 200px -10px rgba(0, 0, 0, 0.5)',
},
maxWidth: {
'2xs': '16rem',
'2.5xs': '14rem',
'3xs': '12rem',
'4xs': '8rem',
'5xs': '4rem',
},
}}}
@Binero try to add this to eslintConfig
settings: {
tailwindcss: {}
},
I have the exact same issue!
Works for me
tailwindcss: {
...
// Need to use path, because default doesn't see custom className
config: path.join(__dirname, './tailwind.config.js'),
},
Describe the bug I created some custom classes in my
tailwind.config.cjs
. These classes are sorted with the tailwindcss prettier plugin, but eslint ignores them and always puts them in front. It does recognise them, as it does not emit anytailwindcss/no-custom-classname
for them.To Reproduce
Snippet from
package.json
:Sorting according to eslint:
Sorting according to prettier:
Expected behavior I'd expect ESLint to use the same sorting as the official prettier plugin.
Environment: