Skip to content

Commit 24e365c

Browse files
committed
updated eslint and prettier configs
1 parent 28ea99e commit 24e365c

8 files changed

Lines changed: 1570 additions & 505 deletions

File tree

.prettierrc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
{
22
"semi": true,
3-
"trailingComma": "none",
4-
"tabWidth": 2,
53
"singleQuote": true,
6-
"printWidth": 125
4+
"tabWidth": 2,
5+
"trailingComma": "es5",
6+
"printWidth": 100,
7+
"arrowParens": "always",
8+
"endOfLine": "auto",
9+
"bracketSpacing": true,
10+
"bracketSameLine": false,
11+
"plugins": ["prettier-plugin-tailwindcss"],
12+
"tailwindConfig": "./tailwind.config.ts",
13+
"tailwindFunctions": ["cn", "cva", "clsx", "classnames", "tw"]
714
}

eslint.config.mjs

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,90 @@
11
import { dirname } from 'path';
22
import { fileURLToPath } from 'url';
33
import { FlatCompat } from '@eslint/eslintrc';
4+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
5+
import typescriptParser from '@typescript-eslint/parser';
6+
// import tailwindcss from 'eslint-plugin-tailwindcss'; // Disabled - v4 compatibility issue
47

58
const __filename = fileURLToPath(import.meta.url);
69
const __dirname = dirname(__filename);
710

811
const compat = new FlatCompat({
9-
baseDirectory: __dirname
12+
baseDirectory: __dirname,
1013
});
1114

1215
const eslintConfig = [
16+
// Global ignores
17+
{
18+
ignores: [
19+
'node_modules/**',
20+
'.next/**',
21+
'out/**',
22+
'build/**',
23+
'dist/**',
24+
'next-env.d.ts',
25+
'tailwind.config.ts',
26+
'next.config.ts',
27+
],
28+
},
29+
30+
// Base Next.js configuration
1331
...compat.extends('next/core-web-vitals', 'next/typescript'),
32+
33+
// TypeScript configuration
1434
{
15-
ignores: ['node_modules/**', '.next/**', 'out/**', 'build/**', 'next-env.d.ts']
16-
}
35+
files: ['**/*.ts', '**/*.tsx'],
36+
languageOptions: {
37+
parser: typescriptParser,
38+
parserOptions: {
39+
project: './tsconfig.json',
40+
ecmaVersion: 'latest',
41+
sourceType: 'module',
42+
ecmaFeatures: {
43+
jsx: true,
44+
},
45+
},
46+
},
47+
plugins: {
48+
'@typescript-eslint': typescriptEslint,
49+
},
50+
rules: {
51+
// TypeScript specific rules
52+
'@typescript-eslint/no-unused-vars': [
53+
'warn',
54+
{
55+
argsIgnorePattern: '^_',
56+
varsIgnorePattern: '^_',
57+
destructuredArrayIgnorePattern: '^_',
58+
},
59+
],
60+
'@typescript-eslint/no-explicit-any': 'warn',
61+
'@typescript-eslint/no-non-null-assertion': 'warn',
62+
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
63+
'@typescript-eslint/prefer-nullish-coalescing': 'error',
64+
'@typescript-eslint/prefer-optional-chain': 'error',
65+
'@typescript-eslint/consistent-type-imports': [
66+
'error',
67+
{
68+
prefer: 'type-imports',
69+
fixStyle: 'inline-type-imports',
70+
},
71+
],
72+
73+
// General rules
74+
'no-console': ['warn', { allow: ['warn', 'error'] }],
75+
'prefer-const': 'error',
76+
'no-var': 'error',
77+
'object-shorthand': 'error',
78+
'prefer-template': 'error',
79+
},
80+
},
81+
82+
// Tailwind CSS configuration - disabled until plugin supports v4
83+
// Note: eslint-plugin-tailwindcss doesn't support Tailwind CSS v4 yet
84+
// Prettier with prettier-plugin-tailwindcss will handle class ordering instead
85+
86+
// Prettier integration - must be last to override other configs
87+
...compat.extends('prettier'),
1788
];
1889

1990
export default eslintConfig;

next.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { NextConfig } from 'next';
22

33
const nextConfig: NextConfig = {
44
/* config options here */
5-
output: 'standalone'
5+
output: 'standalone',
66
};
77

88
export default nextConfig;

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@
2727
"@types/node": "^22",
2828
"@types/react": "^19",
2929
"@types/react-dom": "^19",
30+
"@typescript-eslint/eslint-plugin": "^8.43.0",
31+
"@typescript-eslint/parser": "^8.43.0",
3032
"eslint": "^9",
3133
"eslint-config-next": "15.5.2",
34+
"eslint-config-prettier": "^10.1.8",
35+
"eslint-plugin-tailwindcss": "^3.18.2",
3236
"prettier": "^3.6.2",
37+
"prettier-plugin-tailwindcss": "^0.6.14",
3338
"tailwindcss": "^4",
3439
"typescript": "^5"
3540
}

0 commit comments

Comments
 (0)