-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
164 lines (160 loc) · 5.4 KB
/
.eslintrc.cjs
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
const path = require("path");
/** @type {import("eslint").Linter.Config} */
const config = {
ignorePatterns: ["src/components/ui/*"],
overrides: [
{
files: ["*.js", "*.jsx", "*.cjs"],
env: {
es6: true
},
parserOptions: {
ecmaVersion: 2021,
sourceType: "module"
}
},
{
files: ["*.ts", "*.tsx", "*.jsx"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: path.join(__dirname, "./tsconfig.json")
},
plugins: ["@typescript-eslint", "eslint-plugin-react"],
extends: [
"plugin:@next/next/recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:tailwindcss/recommended",
"plugin:react/recommended"
],
rules: {
"no-restricted-imports": "off",
"@typescript-eslint/no-restricted-imports": [
"error",
{
patterns: ["../*"]
}
],
"@typescript-eslint/consistent-type-imports": [
"warn",
{
prefer: "type-imports",
fixStyle: "inline-type-imports"
}
],
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_"
}
],
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: { attributes: false }
}
],
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"no-unused-vars": "warn",
"no-dupe-else-if": "error",
"no-dupe-keys": "error",
"no-duplicate-imports": "error",
"no-unreachable": "error",
"no-use-before-define": "error",
"dot-notation": "error",
eqeqeq: "error",
"no-lonely-if": "error",
"no-return-await": "error",
"no-useless-catch": "error",
"no-var": "error",
"prefer-const": "error",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
"@typescript-eslint/array-type": ["error", { default: "array-simple" }],
"@typescript-eslint/no-empty-interface": "error",
"consistent-return": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"object-shorthand": "error",
"@typescript-eslint/no-explicit-any": "error",
"no-implicit-coercion": "error",
"@typescript-eslint/return-await": "error",
"no-unneeded-ternary": "error",
"@typescript-eslint/no-confusing-void-expression": "warn",
"@typescript-eslint/no-meaningless-void-operator": "warn",
"no-plusplus": [
"error",
{
allowForLoopAfterthoughts: true
}
],
"@typescript-eslint/prefer-nullish-coalescing": "error",
"no-shadow": "error",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
accessibility: "explicit",
overrides: {
accessors: "off",
constructors: "no-public",
methods: "explicit",
properties: "explicit",
parameterProperties: "explicit"
}
}
],
"@typescript-eslint/consistent-type-exports": [
"error",
{
fixMixedExportsWithInlineTypeSpecifier: true
}
],
"@typescript-eslint/consistent-generic-constructors": "error",
"@typescript-eslint/no-confusing-non-null-assertion": "error",
"@typescript-eslint/no-duplicate-enum-values": "error",
"@typescript-eslint/strict-boolean-expressions": [
"error",
{
allowString: false,
allowNumber: false,
allowNullableObject: false,
allowNullableBoolean: false,
allowNullableString: false,
allowNullableNumber: false,
allowNullableEnum: false,
allowAny: false,
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false
}
],
"no-self-compare": "error",
// React
"react/prop-types": "off",
"react/jsx-key": "error",
"react/jsx-no-target-blank": "error",
"react/jsx-no-useless-fragment": "warn",
"react/no-array-index-key": "warn",
"react/no-deprecated": "warn",
"react/no-unused-state": "error",
"react/button-has-type": "error",
"react/display-name": "error",
"react/hook-use-state": "error",
"react/jsx-fragments": ["error", "element"],
"react/no-children-prop": "off",
"react/react-in-jsx-scope": "off",
// Tailwind
"tailwindcss/classnames-order": "error",
"tailwindcss/enforces-negative-arbitrary-values": "error",
"tailwindcss/enforces-shorthand": "error",
"tailwindcss/no-contradicting-classname": "error",
"tailwindcss/no-custom-classname": "off"
}
}
]
};
module.exports = config;