-
Notifications
You must be signed in to change notification settings - Fork 9
/
.eslintrc.json
98 lines (98 loc) · 2.5 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
{
"env": {
"browser": true,
"jest": true,
"es2021": true
},
"settings": {
"react": {
"version": "detect"
}
},
"extends": [
"plugin:react/recommended",
"standard",
"plugin:jest-dom/recommended",
"plugin:unicorn/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint",
"unicorn",
"jest-dom",
"prettier"
],
"rules": {
"prettier/prettier": ["error",
{
"endOfLine": "auto"
}],
"semi": ["error", "always"],
"object-curly-spacing": ["error", "always"],
"camelcase": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-inferrable-types": [
"warn",
{
"ignoreParameters": true
}
],
"no-underscore-dangle": "off",
"no-shadow": "off",
"no-new": 0,
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/no-unused-vars": "warn",
"class-methods-use-this": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/consistent-destructuring": "off",
"unicorn/consistent-function-scoping": "off",
"import/order": [
"error",
{
"groups": ["builtin", "external", "parent", "sibling", "index"],
"alphabetize": {
"order": "asc"
}
}
],
"unicorn/filename-case": [
"error",
{
"case": "kebabCase",
"ignore": [
"setupTests.ts",
"serviceWorker.ts",
"/*.tsx"
]
}
]
},
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx"],
"plugins": ["@typescript-eslint"],
"rules": {
// https://stackoverflow.com/questions/63818415/react-was-used-before-it-was-defined
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"]
}
},
{
"files": ["*.test.*"],
"rules": {
// For tests it can make sense to pass empty functions as mocks.
"@typescript-eslint/no-empty-function": "off"
}
}
]
}