-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
178 lines (177 loc) · 5.81 KB
/
.eslintrc.js
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
const { builtinModules } = require("node:module");
module.exports = {
ignorePatterns: [".next/", "node_modules/", "*.js"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:node/recommended",
"plugin:@next/next/recommended",
"next/core-web-vitals",
],
env: {
node: true,
browser: true,
},
parserOptions: {
project: "tsconfig.json",
},
plugins: ["react", "jsx-a11y", "import", "@typescript-eslint", "node"],
rules: {
"no-extend-native": "warn",
"no-iterator": "warn",
"no-lone-blocks": "warn",
"no-return-assign": "warn",
"no-useless-computed-key": "warn",
"curly": ["warn", "multi"],
"dot-location": ["warn", "property"],
"eqeqeq": ["warn", "smart"],
"no-else-return": [
"warn",
{
allowElseIf: false,
},
],
"no-extra-bind": "warn",
"no-floating-decimal": "warn",
"no-implicit-coercion": "warn",
"no-multi-spaces": "warn",
"no-restricted-imports": [
"warn",
...builtinModules.map((name) => ({
name,
message: `Use the \`node:\` protocol to import a built-in module`,
})),
],
"no-useless-return": "warn",
"wrap-iife": ["warn", "inside"],
"yoda": [
"warn",
"never",
{
exceptRange: true,
},
],
"no-undef-init": "warn",
"array-bracket-newline": ["warn", "consistent"],
"array-element-newline": ["warn", "consistent"],
"computed-property-spacing": "warn",
"new-parens": "warn",
"no-async-promise-executor": "off",
"no-lonely-if": "warn",
"no-mixed-spaces-and-tabs": "off",
"no-multiple-empty-lines": "warn",
"no-unneeded-ternary": [
"warn",
{
defaultAssignment: false,
},
],
"no-whitespace-before-property": "warn",
"one-var-declaration-per-line": "warn",
"operator-assignment": "warn",
"accessor-pairs": "warn",
"array-callback-return": "warn",
"arrow-body-style": "warn",
"consistent-return": "warn",
"default-case-last": "warn",
"default-case": "warn",
"grouped-accessor-pairs": "warn",
"guard-for-in": "warn",
"no-await-in-loop": "warn",
"no-caller": "warn",
"no-case-declarations": "off",
"no-constructor-return": "warn",
"no-labels": "warn",
"no-multi-str": "warn",
"no-new": "warn",
"no-new-func": "warn",
"no-new-wrappers": "warn",
"no-octal-escape": "warn",
"no-process-exit": "off",
"no-promise-executor-return": "warn",
"no-proto": "warn",
"no-self-compare": "warn",
"no-sequences": "warn",
"no-template-curly-in-string": "warn",
"no-unmodified-loop-condition": "warn",
"no-unreachable-loop": "warn",
"no-unsafe-optional-chaining": "warn",
"no-unused-expressions": "warn",
"no-useless-backreference": "warn",
"no-useless-call": "warn",
"no-useless-concat": "warn",
"no-useless-rename": "warn",
"no-var": "warn",
"no-warning-comments": "warn",
"node/no-missing-import": "off",
"node/no-unsupported-features/es-syntax": [
"error",
{
ignores: ["dynamicImport", "modules"],
},
],
"node/prefer-global/buffer": ["warn", "never"],
"node/prefer-global/console": "warn",
"node/prefer-global/process": ["warn", "never"],
"node/prefer-global/text-decoder": "warn",
"node/prefer-global/text-encoder": "warn",
"node/prefer-global/url-search-params": "warn",
"node/prefer-global/url": "warn",
"node/prefer-promises/dns": "warn",
"node/prefer-promises/fs": "warn",
"object-shorthand": "warn",
"prefer-arrow-callback": "warn",
"prefer-const": "warn",
"prefer-destructuring": "warn",
"prefer-numeric-literals": "warn",
"prefer-promise-reject-errors": "warn",
"prefer-regex-literals": "warn",
"prefer-rest-params": "warn",
"prefer-spread": "warn",
"prefer-template": "warn",
"semi-spacing": "warn",
"semi-style": "warn",
"sort-vars": "warn",
"symbol-description": "warn",
"@typescript-eslint/array-type": "warn",
"@typescript-eslint/consistent-type-assertions": "warn",
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
"@typescript-eslint/consistent-type-imports": "warn",
"@typescript-eslint/class-literal-property-style": "warn",
"@typescript-eslint/member-ordering": "warn",
"@typescript-eslint/no-confusing-non-null-assertion": "warn",
"@typescript-eslint/no-confusing-void-expression": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-extraneous-class": "warn",
"@typescript-eslint/no-implied-eval": "off",
"@typescript-eslint/no-loop-func": "warn",
"@typescript-eslint/no-loss-of-precision": "warn",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-shadow": "warn",
"@typescript-eslint/no-throw-literal": "warn",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn",
"@typescript-eslint/no-unnecessary-condition": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "warn",
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/no-useless-constructor": "warn",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/non-nullable-type-assertion-style": "warn",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-includes": "warn",
"@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
"@typescript-eslint/prefer-ts-expect-error": "warn",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/return-await": "warn",
"@typescript-eslint/strict-boolean-expressions": "warn",
"@typescript-eslint/switch-exhaustiveness-check": "warn",
"@typescript-eslint/unified-signatures": "warn",
},
};