-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
127 lines (115 loc) · 3.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
const path = require("node:path");
const paddingLineBetweenStatements = [
"error",
{ blankLine: "always", next: "return", prev: "*" },
]
.concat(
[
"multiline-block-like",
"multiline-expression",
"multiline-const",
"const",
"type",
"interface",
"if",
]
.map((item) => [
{ blankLine: "always", next: "*", prev: item },
{ blankLine: "always", next: item, prev: "*" },
])
.flat(),
)
.concat([
{
blankLine: "any",
next: ["singleline-const"],
prev: ["singleline-const"],
},
]);
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: path.join(__dirname, "tsconfig.json"),
},
plugins: [
"@typescript-eslint",
"react-hooks",
"@stylistic",
"perfectionist",
"import",
],
rules: {
"@next/next/no-img-element": "off",
"@stylistic/padding-line-between-statements": paddingLineBetweenStatements,
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-use-before-define": "error",
"@typescript-eslint/no-var-requires": "off",
"arrow-body-style": "error",
"camelcase": "off",
"global-require": "off",
"import/no-duplicates": "error",
"jsx-a11y/anchor-is-valid": "off",
"no-console": ["error", { allow: ["warn", "error"] }],
"no-else-return": "error",
"no-shadow": "off",
"no-unused-vars": "off",
"no-useless-return": "error",
"object-shorthand": "error",
"perfectionist/sort-classes": "error",
"perfectionist/sort-enums": "error",
"perfectionist/sort-exports": "error",
"perfectionist/sort-interfaces": "error",
"perfectionist/sort-object-types": "error",
"perfectionist/sort-objects": "error",
"perfectionist/sort-union-types": "error",
"prefer-const": "error",
"prefer-destructuring": ["error"],
"prefer-spread": "error",
"prefer-template": "error",
"quote-props": ["error", "consistent-as-needed"],
"react-hooks/exhaustive-deps": "error",
"react-hooks/rules-of-hooks": "error",
"react/destructuring-assignment": [
"error",
"always",
{ destructureInSignature: "always" },
],
"react/display-name": "off",
"react/function-component-definition": "off",
"react/jsx-boolean-value": "error",
"react/jsx-curly-brace-presence": "error",
"react/jsx-filename-extension": "off",
"react/jsx-fragments": "error",
"react/jsx-key": ["error", { warnOnDuplicates: true }],
"react/jsx-no-useless-fragment": "error",
"react/jsx-one-expression-per-line": "off",
"react/jsx-props-no-spreading": "off",
"react/jsx-sort-props": "error",
"react/no-array-index-key": "off",
"react/no-unescaped-entities": "off",
"react/no-unknown-property": "off",
"react/no-unstable-nested-components": "error",
"react/no-unused-prop-types": "error",
"react/react-in-jsx-scope": "off",
"react/require-default-props": "off",
"react/self-closing-comp": "error",
},
settings: {
react: {
version: "detect",
},
},
};