Skip to content

Commit 6d6cd3e

Browse files
committed
feat(lint): add ESLint for Tailwind rules
1 parent 6f6a7dd commit 6d6cd3e

File tree

14 files changed

+3361
-120
lines changed

14 files changed

+3361
-120
lines changed

eslint.config.mjs

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// @ts-check
2+
3+
import { defineConfig } from "eslint/config";
4+
import nextVitals from "eslint-config-next/core-web-vitals";
5+
import betterTailwindcss from "eslint-plugin-better-tailwindcss";
6+
7+
// biome-ignore lint/style/noDefaultExport: Config file
8+
export default defineConfig([
9+
// Next.js Core Web Vitals config
10+
...nextVitals,
11+
12+
// Better Tailwind CSS plugin configuration
13+
{
14+
plugins: {
15+
"better-tailwindcss": betterTailwindcss,
16+
},
17+
settings: {
18+
"better-tailwindcss": {
19+
// For Tailwind CSS v4, specify the entry point to your CSS file
20+
entryPoint: "src/app/globals.css",
21+
},
22+
},
23+
rules: {
24+
// Tailwind CSS rules
25+
"better-tailwindcss/no-duplicate-classes": "warn",
26+
"better-tailwindcss/no-unnecessary-whitespace": "warn",
27+
"better-tailwindcss/enforce-shorthand-classes": "warn",
28+
"better-tailwindcss/no-unregistered-classes": "error",
29+
"better-tailwindcss/no-conflicting-classes": "error",
30+
31+
// Disable formatting-related rules (Biome handles formatting)
32+
"better-tailwindcss/enforce-consistent-class-order": "off",
33+
"better-tailwindcss/enforce-consistent-line-wrapping": "off",
34+
35+
// Disable all TypeScript ESLint rules (Biome handles TypeScript linting)
36+
"@typescript-eslint/no-require-imports": "off",
37+
"@typescript-eslint/no-unused-vars": "off",
38+
39+
// Disable all import rules (Biome handles imports)
40+
"import/no-anonymous-default-export": "off",
41+
42+
// Disable React stylistic rules that conflict with Biome
43+
"react/jsx-indent": "off",
44+
"react/jsx-indent-props": "off",
45+
"react/jsx-max-props-per-line": "off",
46+
"react/jsx-newline": "off",
47+
"react/jsx-one-expression-per-line": "off",
48+
"react/jsx-wrap-multilines": "off",
49+
},
50+
},
51+
52+
// Global ignores
53+
{
54+
ignores: [
55+
".next/**",
56+
"out/**",
57+
"build/**",
58+
"dist/**",
59+
"node_modules/**",
60+
".velite/**",
61+
"next-env.d.ts",
62+
"postcss.config.mjs",
63+
"tailwind.config.js",
64+
],
65+
},
66+
]);

package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88
"build": "cross-env NODE_ENV=production next build",
99
"analyze": "cross-env NODE_ENV=production next experimental-analyze --serve",
1010
"dev": "next dev -H 0.0.0.0",
11-
"lint": "biome check",
12-
"lint:fix": "biome check --write --unsafe",
11+
"biome": "biome check",
12+
"biome:fix": "biome check --write --unsafe",
13+
"eslint": "eslint .",
14+
"eslint:fix": "eslint . --fix",
15+
"lint": "npm-run-all -s -p biome eslint",
16+
"lint:fix": "npm-run-all -s -p biome:fix eslint:fix",
1317
"typecheck": "tsc --noEmit"
1418
},
1519
"dependencies": {
@@ -41,13 +45,18 @@
4145
"@types/react-dom": "19.2.3",
4246
"babel-plugin-react-compiler": "^1.0.0",
4347
"cross-env": "^10.1.0",
48+
"eslint": "^9.39.1",
49+
"eslint-config-next": "^16.0.8",
50+
"eslint-plugin-better-tailwindcss": "^3.8.0",
51+
"npm-run-all": "^4.1.5",
4452
"postcss": "^8.5.6",
4553
"tailwindcss": "^4.1.17",
4654
"tw-animate-css": "^1.4.0",
4755
"typescript": "^5.9.3",
56+
"typescript-eslint": "^8.49.0",
4857
"velite": "^0.3.1"
4958
},
50-
"packageManager": "pnpm@10.15.0",
59+
"packageManager": "pnpm@10.25.0+sha512.5e82639027af37cf832061bcc6d639c219634488e0f2baebe785028a793de7b525ffcd3f7ff574f5e9860654e098fe852ba8ac5dd5cefe1767d23a020a92f501",
5160
"pnpm": {
5261
"overrides": {
5362
"@types/react": "19.2.7",

0 commit comments

Comments
 (0)