-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
184 lines (177 loc) · 4.94 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require("path");
/** @type {import("eslint").Linter.Config} */
const config = {
overrides: [
{
extends: [
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
files: ["*.ts", "*.tsx"],
parserOptions: {
project: path.join(__dirname, "tsconfig.json"),
},
},
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: path.join(__dirname, "tsconfig.json"),
},
plugins: ["prettier", "simple-import-sort", "import", "@typescript-eslint"],
extends: [
"next/core-web-vitals",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict",
],
rules: {
"@next/next/no-img-element": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
prefer: "type-imports",
fixStyle: "inline-type-imports",
},
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "after-used",
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrors: "none",
},
],
"@typescript-eslint/member-delimiter-style": ["error"],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"no-redeclare": "off",
"@typescript-eslint/no-redeclare": ["error"],
"@typescript-eslint/no-var-requires": "off",
"react/prop-types": "off",
"react/void-dom-elements-no-children": ["error"],
"react/jsx-curly-brace-presence": ["error"],
"react/jsx-first-prop-new-line": ["error", "multiline"],
"react/style-prop-object": ["error"],
"react/sort-comp": ["warn"],
"react/self-closing-comp": "error",
"react/hook-use-state": "error",
"react/function-component-definition": [
"error",
{
namedComponents: "arrow-function",
},
],
"react/jsx-sort-props": [
"error",
{
callbacksLast: true,
shorthandFirst: true,
multiline: "last",
reservedFirst: true,
},
],
"react/button-has-type": ["error"],
"react/jsx-boolean-value": ["error", "never"],
"react/jsx-filename-extension": [
"error",
{
allow: "as-needed",
extensions: [".tsx"],
},
],
"react/jsx-fragments": ["error", "syntax"],
"react/jsx-handler-names": ["error"],
"react/jsx-key": [
"error",
{
checkFragmentShorthand: true,
checkKeyMustBeforeSpread: true,
warnOnDuplicates: true,
},
],
"react/jsx-no-comment-textnodes": ["error"],
"react/jsx-no-constructed-context-values": ["error"],
"react/jsx-no-duplicate-props": ["error"],
"react/jsx-no-leaked-render": ["error"],
"react/jsx-no-target-blank": ["error"],
"react/jsx-no-useless-fragment": [
"error",
{
allowExpressions: true,
},
],
"react/jsx-pascal-case": [
"error",
{
allowNamespace: true,
},
],
"react/no-array-index-key": ["error"],
"react/no-object-type-as-default-prop": ["error"],
"react/no-this-in-sfc": ["error"],
"react/no-unstable-nested-components": ["error"],
"react/prefer-stateless-function": ["error"],
"no-lone-blocks": "off",
camelcase: [
"error",
{
ignoreDestructuring: true,
},
],
curly: ["error", "all"],
"dot-notation": "error",
eqeqeq: ["error", "always"],
"guard-for-in": "error",
"linebreak-style": ["error", "unix"],
"no-array-constructor": "error",
"no-bitwise": "error",
"no-mixed-operators": "error",
"no-multi-assign": "error",
"no-console": [
"warn",
{
allow: ["warn", "error", "info"],
},
],
"no-nested-ternary": "error",
"no-new-object": "error",
"no-new-func": "error",
"no-tabs": "warn",
"no-new-wrappers": "error",
"no-return-assign": ["error", "always"],
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-useless-constructor": "error",
"object-shorthand": ["error", "always"],
"prefer-arrow-callback": "warn",
"prefer-const": "warn",
"prefer-destructuring": [
"warn",
{
array: true,
object: true,
},
{
enforceForRenamedProperties: false,
},
],
"prefer-numeric-literals": "error",
"prefer-rest-params": "error",
"prefer-spread": "warn",
"prefer-template": "warn",
"wrap-iife": ["error", "inside"],
"prettier/prettier": "error",
"sort-imports": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
},
};
module.exports = config;