-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
136 lines (135 loc) · 4.68 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
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"globals": {
"window": true,
"ActiveXObject": true
},
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:unicorn/recommended",
"plugin:jest/recommended"
],
"plugins": [
"import",
"unicorn",
"jest"
],
"rules": {
"quotes": ["error", "double", {
"avoidEscape": true
}],
"semi": ["error", "always", {
"omitLastInOneLineBlock": true
}],
"indent": ["error", 4, {
"SwitchCase": 1
}],
"no-empty": ["error", {
"allowEmptyCatch": true
}],
"unicorn/no-fn-reference-in-iterator": "warn",
"unicorn/no-abusive-eslint-disable": "warn",
"unicorn/prefer-ternary": "off",
"unicorn/no-useless-undefined": "warn",
"unicorn/prevent-abbreviations": "off",
"unicorn/catch-error-name": "off",
"unicorn/explicit-length-check": "off",
"unicorn/no-null": "warn"
},
"overrides": [{
"files": ["*.ts"],
"extends": [
// Базовый набор правил eslint
"eslint:recommended",
// Отключаем правила из базового набора
//"plugin:@typescript-eslint/eslint-recommended",
// Базовые правила для TypeScript
"plugin:@typescript-eslint/recommended",
// Правила TS, требующие инфо о типах
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:unicorn/recommended",
"plugin:jest/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"@typescript-eslint/tslint",
"import",
"unicorn",
"jest"
],
"rules": {
"quotes": ["error", "double", {
"avoidEscape": true
}],
"semi": ["error", "always", {
"omitLastInOneLineBlock": true
}],
"indent": ["error", 4, {
"SwitchCase": 1
}],
"no-empty": ["error", {
"allowEmptyCatch": true
}],
"unicorn/no-fn-reference-in-iterator": "warn",
"unicorn/no-abusive-eslint-disable": "warn",
"unicorn/prefer-ternary": "off",
"unicorn/no-useless-undefined": "warn",
"unicorn/prevent-abbreviations": "off",
"unicorn/catch-error-name": "off",
"unicorn/explicit-length-check": "off",
"unicorn/no-null": "warn",
"@typescript-eslint/ban-ts-comment": "warn",
//"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/restrict-template-expressions": "warn",
"@typescript-eslint/no-use-before-define": "off", // ["error", { "functions": false }],
"@typescript-eslint/prefer-regexp-exec": "warn",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/ban-types": ["warn", {
"types": {
"Function": true
}
}],
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin
"@typescript-eslint/tslint/config": [
"error",
{
"rules": {
"jsdoc-format": true,
"one-line": [
true,
"check-open-brace",
"check-whitespace"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-type"
]
}
}
]
}
}]
}