-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
45 lines (36 loc) · 1.77 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
module.exports = {
"env": {
"es2021": true,
"node": true
},
// "extends": "standard-with-typescript",
// "overrides": [
// ],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"rules": {
"indent": ["error", 2], // Используйте 2 пробела для отступа
"quotes": ["error", "double"], // Одинарные кавычки для строк
// Обязательно указывать типы для параметров функций
"@typescript-eslint/explicit-function-return-type": "error",
// Запрет на использование "any" типа
"@typescript-eslint/no-explicit-any": "error",
// Запрет на неиспользуемые переменные и параметры
"@typescript-eslint/no-unused-vars": "error",
// Запрет на неинициализированные классы
"@typescript-eslint/no-non-null-assertion": "error",
// Обязательно указывать видимость (public/private/protected) для классов и членов классов
// "@typescript-eslint/explicit-member-accessibility": "error",
// Запрет на использование "any" для возвращаемых функций
"@typescript-eslint/explicit-module-boundary-types": "error",
// Обязательно указывать типы для свойств и переменных
"@typescript-eslint/typedef": ["error", { "propertyDeclaration": true, "variableDeclaration": true }],
"no-trailing-spaces": "error",
},
}