@@ -2,9 +2,9 @@ import path from 'node:path';
22import { fileURLToPath } from 'node:url' ;
33
44import antfu from '@antfu/eslint-config' ;
5+ import betterTailwindcss from 'eslint-plugin-better-tailwindcss' ;
56import i18nJsonPlugin from 'eslint-plugin-i18n-json' ;
67import reactCompiler from 'eslint-plugin-react-compiler' ;
7- import tailwind from 'eslint-plugin-tailwindcss' ;
88import testingLibrary from 'eslint-plugin-testing-library' ;
99
1010const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
@@ -82,6 +82,7 @@ export default antfu(
8282 files : [ '**/*.ts' , '**/*.tsx' ] ,
8383 rules : {
8484 'ts/consistent-type-definitions' : [ 'error' , 'type' ] , // Prefer type over interface
85+ 'react-hooks/refs' : 'off' , // Allow useRef without exhaustive-deps
8586 'ts/consistent-type-imports' : [
8687 'warn' ,
8788 {
@@ -93,15 +94,22 @@ export default antfu(
9394 } ,
9495 } ,
9596
96- // TailwindCSS plugin
97- ...tailwind . configs [ 'flat/recommended' ] . map ( config => ( {
98- ...config ,
97+ // Better TailwindCSS plugin
98+ {
99+ files : [ '**/*.{js,jsx,ts,tsx}' ] ,
100+ ...betterTailwindcss . configs . recommended ,
101+ settings : {
102+ 'better-tailwindcss' : {
103+ entryPoint : path . resolve ( __dirname , './src/global.css' ) ,
104+ } ,
105+ } ,
99106 rules : {
100- ...config . rules ,
101- 'tailwindcss/classnames-order' : [ 'warn' , { officialSorting : true } ] ,
102- 'tailwindcss/no-custom-classname' : 'off' ,
107+ ...betterTailwindcss . configs . recommended . rules ,
108+ 'better-tailwindcss/no-unnecessary-whitespace' : 'warn' ,
109+ 'better-tailwindcss/no-unknown-classes' : 'warn' ,
110+ 'better-tailwindcss/enforce-consistent-line-wrapping' : 'off' , // Can be too strict for some cases
103111 } ,
104- } ) ) ,
112+ } ,
105113
106114 // React Compiler plugin
107115 {
0 commit comments