-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
151 lines (151 loc) · 4.35 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
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
{
"extends": [
"airbnb",
"airbnb-typescript",
"airbnb/hooks",
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier"
],
"plugins": ["simple-import-sort"],
"root": true,
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"camelcase": "off",
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-implicit-globals": "error",
"yoda": ["error", "never"],
// next
"@next/next/no-img-element": "off",
// import
"import/prefer-default-export": "off",
"import/no-default-export": "error",
// react
"react/jsx-props-no-spreading": "off",
"react/jsx-sort-props": [
"error",
{
"callbacksLast": true,
"shorthandLast": true,
"reservedFirst": true
}
],
"react/require-default-props": "off",
// simple-import-sort
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
// typescript
"@typescript-eslint/array-type": ["error", { "default": "array" }],
"@typescript-eslint/consistent-type-imports": [
"error",
{ "prefer": "type-imports" }
],
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
}
}
],
"@typescript-eslint/method-signature-style": ["error", "property"],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": ["camelCase"]
},
{
"selector": "function",
"format": ["camelCase", "PascalCase"]
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE", "PascalCase", "snake_case"]
},
{
"selector": "parameter",
"format": ["camelCase", "PascalCase", "snake_case"],
"leadingUnderscore": "allow"
},
{
"selector": "memberLike",
"modifiers": ["private"],
"format": ["camelCase"],
"leadingUnderscore": "require"
},
{
"selector": "typeLike",
"format": ["PascalCase"]
},
{
"selector": "typeProperty",
"format": ["camelCase", "PascalCase", "snake_case", "UPPER_CASE"]
},
{
"selector": "objectLiteralProperty",
"format": ["camelCase", "snake_case", "PascalCase"]
},
{
"selector": "enumMember",
"format": ["PascalCase"]
},
{
"selector": [
"classProperty",
"objectLiteralProperty",
"typeProperty",
"classMethod",
"objectLiteralMethod",
"typeMethod",
"accessor",
"enumMember"
],
"format": null,
"modifiers": ["requiresQuotes"]
}
],
"@typescript-eslint/no-confusing-non-null-assertion": "error",
"@typescript-eslint/no-confusing-void-expression": "error",
"@typescript-eslint/no-dynamic-delete": "error",
"@typescript-eslint/no-invalid-void-type": "error",
"@typescript-eslint/no-meaningless-void-operator": "error",
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/prefer-reduce-type-parameter": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/prefer-ts-expect-error": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": [
"error",
{ "ignoreStringArrays": true }
],
"@typescript-eslint/sort-type-union-intersection-members": "error",
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksVoidReturn": false
}
]
},
"overrides": [
{
// requires default exports for next pages
"files": ["pages/**/*"],
"rules": {
// import
"import/prefer-default-export": "error",
"import/no-default-export": "off"
}
}
]
}