-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.cjs
165 lines (160 loc) · 4.4 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable sonarjs/no-duplicate-string */
require('@rushstack/eslint-patch/modern-module-resolution');
module.exports = {
root: true,
env: {
node: true,
browser: true,
es6: true,
es2021: true,
es2022: true,
commonjs: true,
'vue/setup-compiler-macros': true,
},
extends: [
'plugin:vue/vue3-recommended',
'@vue/standard',
'@vue/typescript/recommended',
'plugin:security/recommended',
'plugin:no-unsanitized/DOM',
'plugin:xss/recommended',
'plugin:sonarjs/recommended',
],
parserOptions: {
ecmaVersion: 2022,
parser: require.resolve('@typescript-eslint/parser'),
extraFileExtensions: ['.vue'],
},
rules: {
/* --------------------------------------------------
Standard Rules
-------------------------------------------------- */
indent: 0,
semi: ['error', 'always'],
quotes: ['error', 'single'],
'no-console': 0,
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-use-before-define': 0,
'no-useless-constructor': 0,
'scss/vendorPrefix': 0,
'func-call-spacing': 0,
'no-new': 0,
'array-bracket-spacing': 0,
'prefer-promise-reject-errors': 0,
'padded-blocks': 0,
'n/no-callback-literal': 0,
'no-tabs': 0,
'no-useless-return': 0,
'operator-linebreak': ['error', 'before'],
'keyword-spacing': [
'error', {
overrides: {
catch: {
before: true,
after: false,
},
},
},
],
'no-trailing-spaces': ['error', {
ignoreComments: true,
skipBlankLines: false,
}],
'space-before-function-paren': ['error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
}],
'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'always-multiline',
}],
/* --------------------------------------------------
TypeScript Rules
-------------------------------------------------- */
'@typescript-eslint/indent': ['error', 'tab'],
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-member-accessibility': ['error'],
'@typescript-eslint/interface-name-prefix': 0,
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/no-useless-constructor': ['error'],
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/consistent-type-imports': ['error'],
'@typescript-eslint/ban-ts-comment': ['error', {
'ts-expect-error': 'allow-with-description',
'ts-ignore': 'allow-with-description',
'ts-nocheck': 'allow-with-description',
'ts-check': 'allow-with-description',
minimumDescriptionLength: 25,
}],
'@typescript-eslint/naming-convention': ['error',
{
selector: 'default',
format: ['PascalCase', 'camelCase', 'snake_case', 'UPPER_CASE'],
},
{
selector: 'function',
format: ['PascalCase', 'camelCase'],
leadingUnderscore: 'forbid',
},
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
leadingUnderscore: 'allow',
},
{
selector: 'memberLike',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
},
],
/* --------------------------------------------------
Vue.JS Rules
-------------------------------------------------- */
'vue/no-v-text-v-html-on-component': 0,
'vue/no-v-html': 0,
'vue/no-multiple-template-root': 0,
'vue/multi-word-component-names': 0,
'vue/html-self-closing': 0,
'vue/no-dupe-keys': 0,
'vue/multiline-html-element-content-newline': ['error', {
allowEmptyLines: true,
}],
'vue/max-attributes-per-line': ['error', {
singleline: 5,
multiline: 1,
}],
'vue/html-indent': ['error', 'tab', {
attribute: 1,
baseIndent: 1,
}],
'vue/script-indent': ['error', 'tab', {
baseIndent: 1,
}],
/* --------------------------------------------------
Security Rules
-------------------------------------------------- */
'security/detect-object-injection': 0,
'security/detect-non-literal-regexp': 0,
'xss/no-location-href-assign': 0,
'xss/no-mixed-html': 0,
'sonarjs/no-nested-template-literals': 0,
'sonarjs/no-duplicate-string': ['error', 6],
'sonarjs/cognitive-complexity': ['error', 250],
'sonarjs/prefer-single-boolean-return': 0,
},
overrides: [
{
files: ['*.vue'],
rules: {
indent: 0,
'@typescript-eslint/indent': 0,
'@typescript-eslint/no-unused-vars': 0,
},
},
],
};