-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
127 lines (124 loc) · 3.38 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
module.exports = {
root: true,
env: {
browser: true,
},
plugins: [
'@typescript-eslint',
'import',
'json',
'unused-imports',
],
parserOptions: {
parser: '@typescript-eslint/parser',
sourceType: 'module',
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended',
],
rules: {
'brace-style': ['error', '1tbs', {
allowSingleLine: true,
}],
'comma-dangle': ['error', {
arrays: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
imports: 'always-multiline',
objects: 'always-multiline',
}],
'indent': ['error', 2, {
ignoreComments: true,
SwitchCase: 1,
}],
'linebreak-style': [2, 'unix'],
'max-depth': ['error', 4],
'max-lines-per-function': ['error', {
max: 30,
skipBlankLines: true,
skipComments: true,
}],
'no-debugger': 'error',
'no-multiple-empty-lines': ['error', {
max: 1,
maxBOF: 0,
maxEOF: 0,
}],
'no-new-wrappers': 'error',
'no-prototype-builtins': 'error',
'no-restricted-imports': ['error', {
paths: [{
name: 'lodash',
message: 'Импортируйте отдельные функции из lodash, в стиле `import %fn% from \'lodash/%fn%\'` во избежание затягивания в сборку lodash целиком',
}],
patterns: [
'!lodash/*',
'!lodash.*',
],
}],
'no-shadow-restricted-names': 'error',
'no-throw-literal': 'error',
'object-curly-spacing': ['error', 'always'],
'padded-blocks': ['error', 'never'],
'quotes': ['error', 'single'],
'semi': ['error', 'never'],
'import/export': 'error',
'import/newline-after-import': 'error',
'import/no-absolute-path': 'error',
'import/no-cycle': 'error',
'import/no-empty-named-blocks': 'error',
'import/no-extraneous-dependencies': 'error',
'import/no-self-import': 'error',
'import/no-useless-path-segments': 'error',
'vue/attributes-order': 'error',
'vue/component-definition-name-casing': ['error', 'PascalCase'],
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
'vue/first-attribute-linebreak': 'error',
'vue/html-closing-bracket-newline': ['error', {
multiline: 'always',
singleline: 'never',
}],
'vue/html-closing-bracket-spacing': 'error',
'vue/html-indent': ['error', 4, {
attribute: 1,
closeBracket: 0,
alignAttributesVertically: true,
ignores: [],
}],
'vue/html-self-closing': ['error', {
html: {
component: 'always',
normal: 'always',
void: 'always',
},
math: 'always',
svg: 'always',
}],
'vue/max-attributes-per-line': ['error', {
singleline: 4,
multiline: 1,
}],
'@typescript-eslint/consistent-type-imports': ['error', {
prefer: 'type-imports',
}],
'@typescript-eslint/no-empty-function': 'off',
'vue/one-component-per-file': 'off',
},
overrides: [{
files: ['.eslintrc.js', 'commitlint.config.js', 'index.cjs'],
env: {
node: true,
},
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
}, {
files: ['*.e2e.ts', '*.test.ts'],
rules: {
'max-lines-per-function': 'off',
},
}],
}