From 1f50bd3a6960093cebcbecc3165eea509ba774bf Mon Sep 17 00:00:00 2001 From: Vladimir Drayling Date: Wed, 5 Aug 2026 12:34:51 +0200 Subject: [PATCH] fix(eslint): configure tailwindcss plugin and error on violations - Fix cssConfigPath (wrong path, was crashing with ENOENT) - Wire tailwindcss rules to *.html templates - warn -> error so CI actually catches violations --- eslint.config.ts | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/eslint.config.ts b/eslint.config.ts index c325b6e..15d9452 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -16,15 +16,21 @@ export default [ 'unused-imports': unusedImports, tailwindcss, }, + // Resolved relative to the nearest eslint.config.ts/package.json above + // the linted file — that's apps/app/, not the workspace root. + settings: { + tailwindcss: { cssConfigPath: './src/styles.css' }, + }, // Override the preset's severities and add the workspace's own rules. rules: { - 'tailwindcss/classnames-order': 'warn', - 'tailwindcss/no-arbitrary-value': 'warn', + 'tailwindcss/classnames-order': 'error', + 'tailwindcss/no-arbitrary-value': 'error', + 'tailwindcss/no-unnecessary-arbitrary-value': 'error', 'tailwindcss/no-custom-classname': [ - 'warn', + 'error', // { whitelist: ['custom\\-*'] }, ], - 'tailwindcss/no-contradicting-classname': 'warn', + 'tailwindcss/no-contradicting-classname': 'error', '@nx/enforce-module-boundaries': [ 'error', { @@ -56,6 +62,12 @@ export default [ }, { files: ['**/*.html'], + plugins: { + tailwindcss, + }, + settings: { + tailwindcss: { cssConfigPath: './src/styles.css' }, + }, rules: { '@angular-eslint/template/attributes-order': [ 'error', @@ -71,6 +83,14 @@ export default [ ], }, ], + 'tailwindcss/classnames-order': 'error', + 'tailwindcss/no-arbitrary-value': 'error', + 'tailwindcss/no-unnecessary-arbitrary-value': 'error', + 'tailwindcss/no-custom-classname': [ + 'error', + // { whitelist: ['custom\\-*'] }, + ], + 'tailwindcss/no-contradicting-classname': 'error', }, }, ];