This repository was archived by the owner on Dec 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.yml
187 lines (171 loc) · 3.24 KB
/
.eslintrc.yml
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
185
186
187
root: true
plugins:
- react
- react-hooks
- lodash
- import
parser: "@typescript-eslint/parser"
settings:
react:
version: detect
ignorePatterns:
- /node_modules
- /dist
- "*.config.js"
- "*.config.cjs"
- "*.config.ts"
extends:
- plugin:react/recommended
- plugin:react/jsx-runtime
- plugin:react-hooks/recommended
- plugin:lodash/recommended
- plugin:import/warnings
- plugin:@typescript-eslint/recommended
- eslint:recommended
env:
browser: true
es2020: true
node: true
parserOptions:
sourceType: module
project:
- tsconfig.json
rules:
# General style
no-trailing-spaces:
- warn
quotes:
- warn
- double
jsx-quotes:
- warn
- prefer-double
prefer-arrow-callback:
- warn
object-curly-spacing:
- warn
- always
array-bracket-spacing:
- warn
- never
keyword-spacing:
- warn
func-call-spacing:
- warn
space-before-blocks:
- warn
arrow-spacing:
- warn
arrow-parens:
- warn
arrow-body-style:
- warn
- as-needed
no-constant-condition:
- warn
- checkLoops: false
import/order:
- warn
- newlines-between: always
import/newline-after-import:
- warn
- count: 2
multiline-ternary:
- warn
- always-multiline
# JSX
react/jsx-indent:
- warn
- 2
react/jsx-tag-spacing:
- warn
react/jsx-curly-spacing:
- warn
- when: never
children: true
react/jsx-equals-spacing:
- warn
- never
react/jsx-first-prop-new-line:
- warn
- multiline
react/jsx-max-props-per-line:
- warn
- maximum: 1
when: multiline
# TypeScript
"@typescript-eslint/consistent-type-definitions":
- error
- type
"@typescript-eslint/explicit-module-boundary-types":
- off
semi:
- off
"@typescript-eslint/semi":
- warn
- never
indent:
- off
"@typescript-eslint/indent":
- warn
- 2
- SwitchCase: 0
offsetTernaryExpressions: true
MemberExpression: off
# Override wonky indent behavior with TypeScript types (unions)
ignoredNodes:
- TSTypeParameterInstantiation
- TSTypeAliasDeclaration *
# Let react/jsx-indent handle this
- JSXElement *
- JSXElement
"@typescript-eslint/member-delimiter-style":
- warn
- multiline:
delimiter: none
singleline:
delimiter: comma
comma-spacing:
- off
"@typescript-eslint/comma-spacing":
- warn
comma-dangle:
- off
"@typescript-eslint/comma-dangle":
- warn
- never
no-unused-vars:
- off
"@typescript-eslint/no-unused-vars":
- warn
- argsIgnorePattern: "^_"
"@typescript-eslint/no-unnecessary-condition":
- warn
- allowConstantLoopConditions: true
"@typescript-eslint/ban-types":
- warn
- types:
object: false
# React
react/function-component-definition:
- warn
- namedComponents: arrow-function
unnamedComponents: arrow-function
react/display-name:
- off
react/prop-types:
- off
# Lodash
lodash/import-scope:
- warn
- member
lodash/prefer-noop:
- warn
lodash/prefer-includes:
- warn
lodash/prefer-constant:
- warn
lodash/prefer-lodash-typecheck:
- warn
lodash/prefer-some:
- warn