-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.json
111 lines (108 loc) · 2.59 KB
/
.eslintrc.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
"root": true,
"parserOptions": {
"project": "./tsconfig.json"
},
"extends": [
"next",
"airbnb",
"airbnb-typescript",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/strict",
"plugin:eslint-comments/recommended",
"plugin:react/jsx-runtime",
"plugin:react-etc/recommended",
"plugin:tailwindcss/recommended",
"prettier",
"prettier/prettier"
],
"plugins": ["simple-import-sort", "regex"],
"rules": {
/* Auto-sort imports and exports */
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn",
"sort-imports": "off",
"import/order": "off",
/* Custom preferences */
"@typescript-eslint/consistent-indexed-object-style": [
"warn",
"index-signature" // Prevent ambiguity with Records & Tuples
],
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
"@typescript-eslint/method-signature-style": "warn", // Force type safety
"curly": ["error", "all"],
"func-names": ["warn", "as-needed"],
"import/no-default-export": "warn", // Default exports are confusing
"import/prefer-default-export": "off",
"jsx-a11y/label-has-associated-control": [
"error",
{ "assert": "either" } // Allow nesting
],
"react/jsx-props-no-spreading": "off", // TypeScript makes this safe
"react/prop-types": "off", // TypeScript makes this safe
"react/require-default-props": "off", // React `defaultProps` are deprecated
"tailwindcss/classnames-order": "off", // Enforced by Prettier
"no-plusplus": "off",
"tailwindcss/no-custom-classname": [
"warn",
{
"cssFiles": [
"**/*.css",
"**/*.scss",
"!**/node_modules",
"!**/.*",
"!**/dist",
"!**/build"
],
"whitelist": ["dark"]
}
],
"regex/invalid": [
"error",
[
{
"regex": "react-i18next",
"replacement": "next-i18next"
}
]
]
},
"overrides": [
{
"files": "*config.js",
"rules": {
"@typescript-eslint/no-var-requires": "off" // Allow CommonJS imports
}
},
{
"files": "*.config.*",
"excludedFiles": "next.config.*",
"rules": {
"import/no-extraneous-dependencies": [
"error",
{ "optionalDependencies": false }
]
}
},
{
"files": "*.d.ts",
"rules": {
"@typescript-eslint/consistent-type-definitions": "off" // Augmentation
}
},
{
"files": ["src/{app,pages}/**", "*.config.*"],
"rules": {
"import/no-default-export": "off",
"import/prefer-default-export": "warn"
}
},
{
"files": "src/pages/api/**",
"rules": {
"import/prefer-default-export": "off"
}
}
],
"ignorePatterns": ["public", "**/generated/**/*"]
}