-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.cjs
111 lines (111 loc) · 3.34 KB
/
.eslintrc.cjs
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
module.exports = {
env: {
es6: true,
},
extends: [
"eslint:recommended",
"airbnb-base",
"plugin:sonarjs/recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
plugins: ["sonarjs", "@typescript-eslint", "prettier"],
ignorePatterns: ["node_modules/", "dist/"],
settings: {
"import/resolver": {
typescript: { project: ["tsconfig.json"] },
},
},
rules: {
// отключенные правила
"consistent-return": 0,
"no-undef": 0,
"no-underscore-dangle": 0,
"no-return-await": 0,
"sonarjs/no-duplicate-string": 0,
"no-plusplus": 0,
"no-irregular-whitespace": 0,
"import/extensions": 0,
"import/prefer-default-export": 0,
"class-methods-use-this": 0,
indent: 0, // отступы ставит prettier
"prettier/prettier": 2,
// обшие
quotes: ["error", "double", { avoidEscape: true }],
"max-len": [
"error",
{
code: 110,
ignoreUrls: true,
ignoreStrings: true,
},
],
"prefer-destructuring": [
"error",
{
object: true,
array: false,
},
],
"no-param-reassign": ["error", { props: false }],
"func-names": ["error", "as-needed"],
"no-use-before-define": ["error", { functions: false }],
"one-var": [
"error",
{
initialized: "never",
uninitialized: "consecutive",
},
],
"import/no-extraneous-dependencies": ["error", { devDependencies: true }],
// правила по переносам строк
"operator-linebreak": [
"error",
"after",
{
overrides: {
"?": "before",
":": "before",
},
},
],
"newline-per-chained-call": 0,
"array-element-newline": ["error", "consistent"],
"array-bracket-newline": ["error", "consistent"],
"object-property-newline": ["error", { allowAllPropertiesOnSameLine: false }],
"object-curly-newline": [
"error",
{
ImportDeclaration: { consistent: true },
ObjectExpression: {
consistent: true,
minProperties: 2,
},
ObjectPattern: { consistent: true },
},
],
"lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
overrides: [
{
files: ["./examples/**/*.js"],
rules: {
"object-property-newline": 0,
"object-curly-newline": 0,
},
},
],
};