-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
193 lines (193 loc) · 4.07 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
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
188
189
190
191
192
193
{
"parser": "@typescript-eslint/parser",
"env": {
"browser": true,
"es2021": true
},
"extends": [
"airbnb",
"airbnb/hooks",
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint"
],
"settings": {
"import/extensions": [
".js",
".jsx",
".ts",
".tsx",
".scss"
]
},
"globals": {
// this is here to provide access to JSX.element which is needed for the rule @typescript-eslint/explicity-module-boundary-types
"JSX": "readonly",
"NodeJS": "readonly",
// this is here because as of Meteor 2.5, Assets is not importable as an ES6 module, and Meteor instructs to just use it as a global
"Assets": "readonly"
},
"rules": {
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": [
"error",
"nofunc"
],
"import/prefer-default-export": "off",
"indent": [
"error",
"tab",
{
"SwitchCase": 1
}
],
"semi": [
"error",
"never"
],
"quotes": [
"error",
"single",
{
"allowTemplateLiterals": true
}
],
"jsx-quotes": [
"error",
"prefer-single"
],
"max-len": "off",
"camelcase": "error",
"no-tabs": "off",
"no-mixed-spaces-and-tabs": "error",
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "never"
}
],
"react/no-array-index-key": "error",
"react/jsx-pascal-case": "error",
"jsx-a11y/label-has-associated-control": "error",
"react/jsx-indent": [
"error",
"tab"
],
"react/jsx-indent-props": [
"error",
"tab"
],
"react/jsx-props-no-spreading": "error",
"array-callback-return": "error",
"consistent-return": "error",
"object-curly-newline": [
"error",
{
"multiline": true
}
],
"react-hooks/exhaustive-deps": "off",
"arrow-parens": "error",
"no-nested-ternary": "error",
"no-undef": "error",
"no-underscore-dangle": "off",
"no-plusplus": "off",
"react/jsx-filename-extension": [
2,
{
"extensions": [
".jsx",
".tsx"
]
}
],
"import/extensions": [
"error",
"never"
],
"import/no-absolute-path": "off",
"no-trailing-spaces": [
"error",
{
"ignoreComments": true
}
],
"prefer-arrow-callback": "error",
"no-unused-expressions": [
"error",
{
"allowShortCircuit": true,
"enforceForJSX": true
}
],
// this and react/prop-types are only disabled in this block - they're
// re-enabled in the "overrides" block below only for .ts and .tsx files
"@typescript-eslint/explicit-module-boundary-types": "off",
"react/prop-types": "off",
"no-lonely-if": "error",
"func-names": "error",
"object-shorthand": "error",
"react/jsx-wrap-multilines": "error",
"operator-linebreak": [
"error",
"before"
],
"no-restricted-syntax": "off",
"import/no-unresolved": "off",
"no-shadow": "off",
"@typescript-eslint/no-shadow": [
"error",
{
"builtinGlobals": true
}
],
"import/order": "error",
"react/jsx-curly-newline": "error",
"linebreak-style": 0,
// this would preferably be on but this rule doesn't support default *params*, only default props
// in functional components, default params are better than default props
// (see https://stackoverflow.com/questions/47774695/react-functional-component-default-props-vs-default-parameters)
// so we'll leave it off until the rule can accommodate that
"react/require-default-props": "off",
// the three below rules are literally all just enforcing that if statements use curly braces
// in this style:
// if (condition) {
// statement
// } else {
// statement
// }
"nonblock-statement-body-position": [
"error",
"below"
],
"brace-style": [
"error",
"1tbs"
],
"curly": [
"error"
],
"no-console": "error",
"react/function-component-definition": [
2,
{
"namedComponents": "arrow-function"
}
],
"class-methods-use-this": "off"
}
}