-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
80 lines (80 loc) · 2.66 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
69
70
71
72
73
74
75
76
77
78
79
80
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"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',
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"@typescript-eslint/tslint",
"import",
"unicorn",
"no-null"
],
"rules": {
"quotes": ["error", "double", {
"avoidEscape": true
}],
"semi": ["error", "always", {
"omitLastInOneLineBlock": true
}],
"indent": ["error", 4, {
"SwitchCase": 1
}],
"no-empty": ["error", {
"allowEmptyCatch": true
}],
"@typescript-eslint/ban-ts-ignore": "warn",
"@typescript-eslint/no-use-before-define": "warn", // ["error", { "functions": false }],
"@typescript-eslint/camelcase": "warn",
"@typescript-eslint/prefer-regexp-exec": "warn",
"@typescript-eslint/explicit-function-return-type": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/catch-error-name": "off",
"unicorn/explicit-length-check": "off",
"unicorn/no-nested-ternary": "warn",
"no-null/no-null": "warn",
// 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"
]
}
}
]
}
};