-
Notifications
You must be signed in to change notification settings - Fork 39
/
.eslintrc.js
68 lines (57 loc) · 1.63 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
module.exports = {
parser: "@typescript-eslint/parser",
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
sourceType: "module",
},
settings: {
react: {
version: "detect",
},
},
env: {
es2020: true,
node: true,
},
rules: {
// Use Array<> and ReadonlyArray<> syntax in types.
"@typescript-eslint/array-type": [
"error",
{
default: "generic",
readonly: "generic",
},
],
// Mandatory return types clutters the code too much.
"@typescript-eslint/explicit-module-boundary-types": "off",
// Allow empty interfaces, since a lot of components don't require props.
"@typescript-eslint/no-empty-interface": "off",
// var-require is used when importing assets.
"@typescript-eslint/no-var-requires": "off",
// Always use strict comparisons.
eqeqeq: "error",
// Use fat arrow function style.
"func-style": "error",
// Forbid reassigning parameters.
"no-param-reassign": "error",
// Do not allow unused expressions.
"no-unused-expressions": "error",
// Prefer const over let.
"prefer-const": "error",
// Prefer template strings over concatenating with plus.
"prefer-template": "error",
// Allow unescaped single and double quotes.
"react/no-unescaped-entities": ["error", { forbid: [">", "}"] }],
// Turn off react-in-jsx-scope, because the rule doesn't seem to work with React 17's JSX.
"react/react-in-jsx-scope": "off",
},
};