@blueking/eslint-config-bk 3.0.0-beta.3 → 3.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -5
- package/package.json +7 -5
- package/tencent/.oxlintrc.json +930 -0
- package/tencent/base.js +272 -117
- package/tencent/ts.js +228 -20
- package/tencent/vue.common.rule.js +83 -18
- package/tencent/vue.js +9 -6
- package/tencent/vue.rule.js +4 -3
- package/tencent/vue3.js +10 -7
- package/tencent/vue3.rule.js +4 -3
- package/ts.js +6 -6
- package/vue.js +6 -6
- package/vue3.js +6 -6
- package/vue3ts.js +7 -8
- package/vuets.js +7 -8
- package/tencent/prettier.js +0 -30
package/tencent/ts.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Tencent is pleased to support the open source community by making
|
|
3
3
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
4
4
|
*
|
|
5
|
-
* Copyright (C) 2021
|
|
5
|
+
* Copyright (C) 2021 Tencent. All rights reserved.
|
|
6
6
|
*
|
|
7
7
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
8
8
|
*
|
|
@@ -23,23 +23,240 @@
|
|
|
23
23
|
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
24
24
|
* IN THE SOFTWARE.
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
27
|
+
import pluginTypeScript from '@typescript-eslint/eslint-plugin';
|
|
28
|
+
import parserTypeScript from '@typescript-eslint/parser';
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
const stylisticRules = {
|
|
31
|
+
'@stylistic/brace-style': 'error', // 大括号风格
|
|
32
|
+
'@stylistic/comma-spacing': ['error', { before: false, after: true }], // 逗号空格
|
|
33
|
+
'@stylistic/function-call-spacing': ['error', 'never'], // 函数调用括号前空格
|
|
34
|
+
'@stylistic/indent': [
|
|
35
|
+
'warn',
|
|
36
|
+
2,
|
|
37
|
+
{
|
|
38
|
+
SwitchCase: 1,
|
|
39
|
+
VariableDeclarator: 1,
|
|
40
|
+
outerIIFEBody: 1,
|
|
41
|
+
FunctionDeclaration: { parameters: 1, body: 1 },
|
|
42
|
+
FunctionExpression: { parameters: 1, body: 1 },
|
|
43
|
+
CallExpression: { arguments: 1 },
|
|
44
|
+
ArrayExpression: 1,
|
|
45
|
+
ObjectExpression: 1,
|
|
46
|
+
ImportDeclaration: 1,
|
|
47
|
+
flatTernaryExpressions: false,
|
|
48
|
+
ignoredNodes: [
|
|
49
|
+
'JSXElement',
|
|
50
|
+
'JSXElement > *',
|
|
51
|
+
'JSXAttribute',
|
|
52
|
+
'JSXIdentifier',
|
|
53
|
+
'JSXNamespacedName',
|
|
54
|
+
'JSXMemberExpression',
|
|
55
|
+
'JSXSpreadAttribute',
|
|
56
|
+
'JSXExpressionContainer',
|
|
57
|
+
'JSXOpeningElement',
|
|
58
|
+
'JSXClosingElement',
|
|
59
|
+
'JSXFragment',
|
|
60
|
+
'JSXOpeningFragment',
|
|
61
|
+
'JSXClosingFragment',
|
|
62
|
+
'JSXText',
|
|
63
|
+
'JSXEmptyExpression',
|
|
64
|
+
'JSXSpreadChild',
|
|
65
|
+
],
|
|
66
|
+
ignoreComments: false,
|
|
67
|
+
},
|
|
68
|
+
], // 缩进
|
|
69
|
+
'@stylistic/keyword-spacing': [
|
|
70
|
+
'error',
|
|
71
|
+
{
|
|
72
|
+
overrides: {
|
|
73
|
+
if: { after: true },
|
|
74
|
+
for: { after: true },
|
|
75
|
+
while: { after: true },
|
|
76
|
+
else: { after: true },
|
|
77
|
+
},
|
|
78
|
+
before: true,
|
|
79
|
+
after: true,
|
|
80
|
+
},
|
|
81
|
+
], // 关键字空格
|
|
82
|
+
'@stylistic/quotes': ['warn', 'single', { allowTemplateLiterals: false }], // 字符串引号
|
|
83
|
+
'@stylistic/semi': ['error', 'always'], // 分号
|
|
84
|
+
'@stylistic/space-before-function-paren': [
|
|
85
|
+
'error',
|
|
86
|
+
{ anonymous: 'always', named: 'never', asyncArrow: 'always' },
|
|
87
|
+
], // 函数括号前空格
|
|
88
|
+
'@stylistic/type-annotation-spacing': 'error', // 类型注解空格
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const tsRules = {
|
|
92
|
+
// https://typescript-eslint.io/rules/adjacent-overload-signatures/
|
|
93
|
+
// 相邻重载签名必须合并
|
|
94
|
+
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
95
|
+
|
|
96
|
+
// https://typescript-eslint.io/rules/consistent-type-definitions/
|
|
97
|
+
// 类型定义风格(interface/type),不强制
|
|
98
|
+
'@typescript-eslint/consistent-type-definitions': 'off',
|
|
99
|
+
|
|
100
|
+
// https://typescript-eslint.io/rules/explicit-member-accessibility/
|
|
101
|
+
// 成员可访问性修饰符(public/private/protected),不强制
|
|
102
|
+
'@typescript-eslint/explicit-member-accessibility': 'off',
|
|
103
|
+
|
|
104
|
+
// https://typescript-eslint.io/rules/member-ordering/
|
|
105
|
+
// 类成员顺序
|
|
106
|
+
'@typescript-eslint/member-ordering': [
|
|
107
|
+
'error',
|
|
108
|
+
{
|
|
109
|
+
default: [
|
|
110
|
+
'public-static-field',
|
|
111
|
+
'protected-static-field',
|
|
112
|
+
'private-static-field',
|
|
113
|
+
'static-field',
|
|
114
|
+
'public-static-method',
|
|
115
|
+
'protected-static-method',
|
|
116
|
+
'private-static-method',
|
|
117
|
+
'static-method',
|
|
118
|
+
'public-instance-field',
|
|
119
|
+
'protected-instance-field',
|
|
120
|
+
'private-instance-field',
|
|
121
|
+
'public-field',
|
|
122
|
+
'protected-field',
|
|
123
|
+
'private-field',
|
|
124
|
+
'instance-field',
|
|
125
|
+
'field',
|
|
126
|
+
'constructor',
|
|
127
|
+
'public-instance-method',
|
|
128
|
+
'protected-instance-method',
|
|
129
|
+
'private-instance-method',
|
|
130
|
+
'public-method',
|
|
131
|
+
'protected-method',
|
|
132
|
+
'private-method',
|
|
133
|
+
'instance-method',
|
|
134
|
+
'method',
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
|
|
139
|
+
// https://typescript-eslint.io/rules/method-signature-style/
|
|
140
|
+
// 方法签名风格,不强制
|
|
141
|
+
'@typescript-eslint/method-signature-style': 'off',
|
|
142
|
+
|
|
143
|
+
// https://typescript-eslint.io/rules/no-array-constructor/
|
|
144
|
+
// 禁止使用 Array 构造函数
|
|
145
|
+
'@typescript-eslint/no-array-constructor': 'error',
|
|
146
|
+
|
|
147
|
+
// https://typescript-eslint.io/rules/no-dupe-class-members/
|
|
148
|
+
// 禁止类成员重复
|
|
149
|
+
'@typescript-eslint/no-dupe-class-members': 'error',
|
|
150
|
+
|
|
151
|
+
// https://typescript-eslint.io/rules/no-empty-interface/
|
|
152
|
+
// 禁止空接口
|
|
153
|
+
'@typescript-eslint/no-empty-interface': 'error',
|
|
154
|
+
|
|
155
|
+
// https://typescript-eslint.io/rules/no-inferrable-types/
|
|
156
|
+
// 禁止多余的类型推断
|
|
157
|
+
'@typescript-eslint/no-inferrable-types': 'warn',
|
|
158
|
+
|
|
159
|
+
// https://typescript-eslint.io/rules/no-namespace/
|
|
160
|
+
// 禁止使用 namespace,允许声明和定义文件
|
|
161
|
+
'@typescript-eslint/no-namespace': [
|
|
162
|
+
'error',
|
|
163
|
+
{ allowDeclarations: true, allowDefinitionFiles: true },
|
|
164
|
+
],
|
|
165
|
+
|
|
166
|
+
// https://typescript-eslint.io/rules/no-non-null-asserted-optional-chain/
|
|
167
|
+
// 禁止在可选链后使用非空断言
|
|
168
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
|
|
169
|
+
|
|
170
|
+
// https://typescript-eslint.io/rules/no-parameter-properties/
|
|
171
|
+
// 禁止构造函数参数属性,不强制
|
|
172
|
+
'@typescript-eslint/no-parameter-properties': 'off',
|
|
173
|
+
|
|
174
|
+
// https://typescript-eslint.io/rules/no-require-imports/
|
|
175
|
+
// 禁止 require 导入
|
|
176
|
+
'@typescript-eslint/no-require-imports': 'error',
|
|
177
|
+
|
|
178
|
+
// https://typescript-eslint.io/rules/no-this-alias/
|
|
179
|
+
// 禁止 this 赋值给其他变量,允许解构
|
|
180
|
+
'@typescript-eslint/no-this-alias': ['error', { allowDestructuring: true }],
|
|
181
|
+
|
|
182
|
+
// https://typescript-eslint.io/rules/no-unused-expressions/
|
|
183
|
+
// 禁止无用表达式,允许短路、三元、tagged template
|
|
184
|
+
'@typescript-eslint/no-unused-expressions': [
|
|
185
|
+
'error',
|
|
186
|
+
{
|
|
187
|
+
allowShortCircuit: true,
|
|
188
|
+
allowTernary: true,
|
|
189
|
+
allowTaggedTemplates: true,
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
|
|
193
|
+
// https://typescript-eslint.io/rules/no-unused-vars/
|
|
194
|
+
// 禁止未使用变量,允许下划线开头
|
|
195
|
+
'@typescript-eslint/no-unused-vars': [
|
|
196
|
+
'error',
|
|
197
|
+
{
|
|
198
|
+
args: 'after-used',
|
|
199
|
+
ignoreRestSiblings: true,
|
|
200
|
+
argsIgnorePattern: '^_.+',
|
|
201
|
+
varsIgnorePattern: '^_.+',
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
|
|
205
|
+
// https://typescript-eslint.io/rules/no-useless-constructor/
|
|
206
|
+
// 禁止无用构造函数
|
|
207
|
+
'@typescript-eslint/no-useless-constructor': 'warn',
|
|
208
|
+
|
|
209
|
+
// https://typescript-eslint.io/rules/prefer-for-of/
|
|
210
|
+
// 优先使用 for-of
|
|
211
|
+
'@typescript-eslint/prefer-for-of': 'warn',
|
|
212
|
+
|
|
213
|
+
// https://typescript-eslint.io/rules/prefer-function-type/
|
|
214
|
+
// 优先函数类型定义,不强制
|
|
215
|
+
'@typescript-eslint/prefer-function-type': 'off',
|
|
216
|
+
|
|
217
|
+
// https://typescript-eslint.io/rules/prefer-namespace-keyword/
|
|
218
|
+
// 优先使用 namespace 关键字
|
|
219
|
+
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
220
|
+
|
|
221
|
+
// https://typescript-eslint.io/rules/triple-slash-reference/
|
|
222
|
+
// 三斜线指令规范
|
|
223
|
+
'@typescript-eslint/triple-slash-reference': [
|
|
224
|
+
'error',
|
|
225
|
+
{ path: 'never', types: 'always', lib: 'always' },
|
|
226
|
+
],
|
|
227
|
+
|
|
228
|
+
// https://typescript-eslint.io/rules/typedef/
|
|
229
|
+
// 类型定义要求
|
|
230
|
+
'@typescript-eslint/typedef': [
|
|
231
|
+
'error',
|
|
232
|
+
{
|
|
233
|
+
arrayDestructuring: false,
|
|
234
|
+
arrowParameter: false,
|
|
235
|
+
memberVariableDeclaration: false,
|
|
236
|
+
objectDestructuring: false,
|
|
237
|
+
parameter: false,
|
|
238
|
+
propertyDeclaration: true,
|
|
239
|
+
variableDeclaration: false,
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
|
|
243
|
+
// https://typescript-eslint.io/rules/unified-signatures/
|
|
244
|
+
// 合并可统一的函数重载签名
|
|
245
|
+
'@typescript-eslint/unified-signatures': 'error',
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
export default [
|
|
30
249
|
{
|
|
31
250
|
files: ['**/*.?([cm])ts', '**/*.?([cm])tsx'],
|
|
32
251
|
languageOptions: {
|
|
33
252
|
parser: parserTypeScript,
|
|
34
|
-
|
|
35
|
-
sourceType: 'module',
|
|
36
|
-
},
|
|
253
|
+
sourceType: 'module',
|
|
37
254
|
},
|
|
38
255
|
plugins: {
|
|
39
256
|
'@typescript-eslint': pluginTypeScript,
|
|
257
|
+
'@stylistic': stylistic,
|
|
40
258
|
},
|
|
41
259
|
rules: {
|
|
42
|
-
...pluginTypeScript.configs.recommended.rules,
|
|
43
260
|
camelcase: 'off',
|
|
44
261
|
'dot-notation': 'off',
|
|
45
262
|
'no-array-constructor': 'off',
|
|
@@ -51,18 +268,9 @@ module.exports = [
|
|
|
51
268
|
'no-underscore-dangle': 'off',
|
|
52
269
|
'no-unused-vars': 'off',
|
|
53
270
|
'no-useless-constructor': 'off',
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
'error',
|
|
58
|
-
{
|
|
59
|
-
args: 'after-used',
|
|
60
|
-
ignoreRestSiblings: true,
|
|
61
|
-
argsIgnorePattern: '^_.*',
|
|
62
|
-
varsIgnorePattern: '^_.*',
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
'@typescript-eslint/no-useless-constructor': 'warn',
|
|
271
|
+
...pluginTypeScript.configs.recommended.rules,
|
|
272
|
+
...stylisticRules,
|
|
273
|
+
...tsRules,
|
|
66
274
|
},
|
|
67
275
|
},
|
|
68
276
|
{
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Tencent is pleased to support the open source community by making
|
|
3
3
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
4
4
|
*
|
|
5
|
-
* Copyright (C) 2021
|
|
5
|
+
* Copyright (C) 2021 Tencent. All rights reserved.
|
|
6
6
|
*
|
|
7
7
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
8
8
|
*
|
|
@@ -28,7 +28,85 @@
|
|
|
28
28
|
* Vue共用ESLint规则
|
|
29
29
|
* 这个文件包含Vue2和Vue3共用的ESLint规则
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
const stylisticRules = {
|
|
32
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/array-bracket-spacing.md
|
|
33
|
+
// 数组括号内是否有空格
|
|
34
|
+
'vue/array-bracket-spacing': ['error', 'never'],
|
|
35
|
+
|
|
36
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/arrow-spacing.md
|
|
37
|
+
// 箭头函数箭头前后空格
|
|
38
|
+
'vue/arrow-spacing': ['error', { before: true, after: true }],
|
|
39
|
+
|
|
40
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/block-spacing.md
|
|
41
|
+
// 代码块大括号内空格
|
|
42
|
+
'vue/block-spacing': ['error', 'always'],
|
|
43
|
+
|
|
44
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/brace-style.md
|
|
45
|
+
// 大括号风格
|
|
46
|
+
'vue/brace-style': ['error', '1tbs', { allowSingleLine: false }],
|
|
47
|
+
|
|
48
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-closing-bracket-spacing.md
|
|
49
|
+
// 标签闭合括号前的空格
|
|
50
|
+
'vue/html-closing-bracket-spacing': [
|
|
51
|
+
'error',
|
|
52
|
+
{ startTag: 'never', endTag: 'never', selfClosingTag: 'always' },
|
|
53
|
+
],
|
|
54
|
+
|
|
55
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-end-tags.md
|
|
56
|
+
// 强制要求结束标签
|
|
57
|
+
'vue/html-end-tags': 'error',
|
|
58
|
+
|
|
59
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-indent.md
|
|
60
|
+
// html 缩进风格
|
|
61
|
+
'vue/html-indent': [
|
|
62
|
+
'error',
|
|
63
|
+
2,
|
|
64
|
+
{
|
|
65
|
+
attribute: 1,
|
|
66
|
+
baseIndent: 1,
|
|
67
|
+
closeBracket: 0,
|
|
68
|
+
alignAttributesVertically: true,
|
|
69
|
+
ignores: [],
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
|
|
73
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-quotes.md
|
|
74
|
+
// html 属性值必须使用双引号
|
|
75
|
+
'vue/html-quotes': ['error', 'double'],
|
|
76
|
+
|
|
77
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/key-spacing.md
|
|
78
|
+
// 对象键值冒号空格
|
|
79
|
+
'vue/key-spacing': [
|
|
80
|
+
'error',
|
|
81
|
+
{ beforeColon: false, afterColon: true },
|
|
82
|
+
],
|
|
83
|
+
|
|
84
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/keyword-spacing.md
|
|
85
|
+
// 关键字前后空格
|
|
86
|
+
'vue/keyword-spacing': ['error', { before: true, after: true }],
|
|
87
|
+
|
|
88
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-multi-spaces.md
|
|
89
|
+
// 删除 html 标签中连续多个不用于缩进的空格
|
|
90
|
+
'vue/no-multi-spaces': 'error',
|
|
91
|
+
|
|
92
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-spaces-around-equal-signs-in-attribute.md
|
|
93
|
+
// 属性等号两边不能有空格
|
|
94
|
+
'vue/no-spaces-around-equal-signs-in-attribute': 'error',
|
|
95
|
+
|
|
96
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/object-curly-spacing.md
|
|
97
|
+
// 对象写在一行时,大括号里需要空格
|
|
98
|
+
'vue/object-curly-spacing': ['error', 'always'],
|
|
99
|
+
|
|
100
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/space-infix-ops.md
|
|
101
|
+
// 操作符两边空格
|
|
102
|
+
'vue/space-infix-ops': 'error',
|
|
103
|
+
|
|
104
|
+
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/space-unary-ops.md
|
|
105
|
+
// 一元操作符前后空格
|
|
106
|
+
'vue/space-unary-ops': ['error', { words: true, nonwords: false }],
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export default {
|
|
32
110
|
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/multi-word-component-names.md
|
|
33
111
|
'vue/multi-word-component-names': 'off',
|
|
34
112
|
|
|
@@ -189,10 +267,6 @@ module.exports = {
|
|
|
189
267
|
// 组件必须要直接被 export。不限制
|
|
190
268
|
'vue/require-direct-export': 'off',
|
|
191
269
|
|
|
192
|
-
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/require-prop-types.md
|
|
193
|
-
// props 必须要有 type。
|
|
194
|
-
'vue/require-prop-types': 'error',
|
|
195
|
-
|
|
196
270
|
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/require-valid-default-prop.md
|
|
197
271
|
// props 默认值必须有效。不限制
|
|
198
272
|
'vue/require-valid-default-prop': 'off',
|
|
@@ -201,18 +275,6 @@ module.exports = {
|
|
|
201
275
|
// 单行 html 元素后面必须换行。不限制
|
|
202
276
|
'vue/singleline-html-element-content-newline': 'off',
|
|
203
277
|
|
|
204
|
-
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/space-infix-ops.md
|
|
205
|
-
// 二元操作符两边要有空格
|
|
206
|
-
'vue/space-infix-ops': 'error',
|
|
207
|
-
|
|
208
|
-
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/space-unary-ops.md
|
|
209
|
-
// new, delete, typeof, void, yield 等后面必须有空格,一元操作符 -, +, --, ++, !, !! 禁止有空格
|
|
210
|
-
'vue/space-unary-ops': ['error', { words: true, nonwords: false }],
|
|
211
|
-
|
|
212
|
-
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/this-in-template.md
|
|
213
|
-
// 不允许在 template 中使用 this
|
|
214
|
-
'vue/this-in-template': ['error', 'never'],
|
|
215
|
-
|
|
216
278
|
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/use-v-on-exact.md
|
|
217
279
|
// 强制使用精确修饰词。不限制
|
|
218
280
|
'vue/use-v-on-exact': 'off',
|
|
@@ -228,4 +290,7 @@ module.exports = {
|
|
|
228
290
|
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/v-on-style.md
|
|
229
291
|
// v-on 指令的写法。限制简写
|
|
230
292
|
'vue/v-on-style': ['error', 'shorthand'],
|
|
293
|
+
|
|
294
|
+
// 格式化相关
|
|
295
|
+
...stylisticRules,
|
|
231
296
|
};
|
package/tencent/vue.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Tencent is pleased to support the open source community by making
|
|
3
3
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
4
4
|
*
|
|
5
|
-
* Copyright (C) 2021
|
|
5
|
+
* Copyright (C) 2021 Tencent. All rights reserved.
|
|
6
6
|
*
|
|
7
7
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
8
8
|
*
|
|
@@ -23,12 +23,15 @@
|
|
|
23
23
|
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
24
24
|
* IN THE SOFTWARE.
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const vueRules = require('./vue.rule');
|
|
26
|
+
// ESM rewrite
|
|
27
|
+
import pluginVue from 'eslint-plugin-vue';
|
|
28
|
+
import parserVue from 'vue-eslint-parser';
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
import parserTypeScript from '@typescript-eslint/parser';
|
|
31
|
+
|
|
32
|
+
import vueRules from './vue.rule.js';
|
|
33
|
+
|
|
34
|
+
export default [
|
|
32
35
|
{
|
|
33
36
|
files: ['**/*.vue'],
|
|
34
37
|
languageOptions: {
|
package/tencent/vue.rule.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Tencent is pleased to support the open source community by making
|
|
3
3
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
4
4
|
*
|
|
5
|
-
* Copyright (C) 2021
|
|
5
|
+
* Copyright (C) 2021 Tencent. All rights reserved.
|
|
6
6
|
*
|
|
7
7
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
8
8
|
*
|
|
@@ -23,9 +23,10 @@
|
|
|
23
23
|
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
24
24
|
* IN THE SOFTWARE.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
// ESM rewrite
|
|
27
|
+
import commonVueRules from './vue.common.rule.js';
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
export default {
|
|
29
30
|
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/v-on-event-hyphenation.md
|
|
30
31
|
'vue/v-on-event-hyphenation': [
|
|
31
32
|
'warn',
|
package/tencent/vue3.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Tencent is pleased to support the open source community by making
|
|
3
3
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
4
4
|
*
|
|
5
|
-
* Copyright (C) 2021
|
|
5
|
+
* Copyright (C) 2021 Tencent. All rights reserved.
|
|
6
6
|
*
|
|
7
7
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
8
8
|
*
|
|
@@ -23,23 +23,26 @@
|
|
|
23
23
|
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
24
24
|
* IN THE SOFTWARE.
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const vue3Rules = require('./vue3.rule');
|
|
26
|
+
// ESM rewrite
|
|
27
|
+
import pluginVue from 'eslint-plugin-vue';
|
|
28
|
+
import parserVue from 'vue-eslint-parser';
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
import parserTypeScript from '@typescript-eslint/parser';
|
|
31
|
+
|
|
32
|
+
import vue3Rules from './vue3.rule.js';
|
|
33
|
+
|
|
34
|
+
export default [
|
|
32
35
|
{
|
|
33
36
|
files: ['**/*.vue'],
|
|
34
37
|
languageOptions: {
|
|
35
38
|
parser: parserVue,
|
|
39
|
+
sourceType: 'module',
|
|
36
40
|
parserOptions: {
|
|
37
41
|
ecmaFeatures: {
|
|
38
42
|
jsx: true,
|
|
39
43
|
},
|
|
40
44
|
extraFileExtensions: ['.vue'],
|
|
41
45
|
parser: parserTypeScript,
|
|
42
|
-
sourceType: 'module',
|
|
43
46
|
},
|
|
44
47
|
},
|
|
45
48
|
plugins: {
|
package/tencent/vue3.rule.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Tencent is pleased to support the open source community by making
|
|
3
3
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
4
4
|
*
|
|
5
|
-
* Copyright (C) 2021
|
|
5
|
+
* Copyright (C) 2021 Tencent. All rights reserved.
|
|
6
6
|
*
|
|
7
7
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
8
8
|
*
|
|
@@ -23,9 +23,10 @@
|
|
|
23
23
|
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
24
24
|
* IN THE SOFTWARE.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
// ESM rewrite
|
|
27
|
+
import commonVueRules from './vue.common.rule.js';
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
export default {
|
|
29
30
|
// https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/define-macros-order.md
|
|
30
31
|
'vue/define-macros-order': [
|
|
31
32
|
'error',
|
package/ts.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Tencent is pleased to support the open source community by making
|
|
3
3
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
4
4
|
*
|
|
5
|
-
* Copyright (C) 2021
|
|
5
|
+
* Copyright (C) 2021 Tencent. All rights reserved.
|
|
6
6
|
*
|
|
7
7
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
8
8
|
*
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
24
24
|
* IN THE SOFTWARE.
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
|
-
const baseConfig = require('./tencent/base');
|
|
28
|
-
const tsConfig = require('./tencent/ts');
|
|
29
|
-
const prettierConfig = require('./tencent/prettier');
|
|
26
|
+
import { defineConfig } from 'eslint/config';
|
|
30
27
|
|
|
31
|
-
|
|
28
|
+
import baseConfig from './tencent/base.js';
|
|
29
|
+
import tsConfig from './tencent/ts.js';
|
|
30
|
+
|
|
31
|
+
export default defineConfig([baseConfig, tsConfig]);
|
package/vue.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Tencent is pleased to support the open source community by making
|
|
3
3
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
4
4
|
*
|
|
5
|
-
* Copyright (C) 2021
|
|
5
|
+
* Copyright (C) 2021 Tencent. All rights reserved.
|
|
6
6
|
*
|
|
7
7
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
8
8
|
*
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
24
24
|
* IN THE SOFTWARE.
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
|
-
const baseConfig = require('./tencent/base');
|
|
28
|
-
const vueConfig = require('./tencent/vue');
|
|
29
|
-
const prettierConfig = require('./tencent/prettier');
|
|
26
|
+
import { defineConfig } from 'eslint/config';
|
|
30
27
|
|
|
31
|
-
|
|
28
|
+
import baseConfig from './tencent/base.js';
|
|
29
|
+
import vueConfig from './tencent/vue.js';
|
|
30
|
+
|
|
31
|
+
export default defineConfig([baseConfig, vueConfig]);
|
package/vue3.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Tencent is pleased to support the open source community by making
|
|
3
3
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
4
4
|
*
|
|
5
|
-
* Copyright (C) 2021
|
|
5
|
+
* Copyright (C) 2021 Tencent. All rights reserved.
|
|
6
6
|
*
|
|
7
7
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
8
8
|
*
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
24
24
|
* IN THE SOFTWARE.
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
|
-
const baseConfig = require('./tencent/base');
|
|
28
|
-
const vue3Config = require('./tencent/vue3');
|
|
29
|
-
const prettierConfig = require('./tencent/prettier');
|
|
26
|
+
import { defineConfig } from 'eslint/config';
|
|
30
27
|
|
|
31
|
-
|
|
28
|
+
import baseConfig from './tencent/base.js';
|
|
29
|
+
import vue3Config from './tencent/vue3.js';
|
|
30
|
+
|
|
31
|
+
export default defineConfig([baseConfig, vue3Config]);
|
package/vue3ts.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Tencent is pleased to support the open source community by making
|
|
3
3
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
4
4
|
*
|
|
5
|
-
* Copyright (C) 2021
|
|
5
|
+
* Copyright (C) 2021 Tencent. All rights reserved.
|
|
6
6
|
*
|
|
7
7
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
8
8
|
*
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
24
24
|
* IN THE SOFTWARE.
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
import { defineConfig } from 'eslint/config';
|
|
27
|
+
|
|
28
|
+
import baseConfig from './tencent/base.js';
|
|
29
|
+
import tsConfig from './tencent/ts.js';
|
|
30
|
+
import vue3Config from './tencent/vue3.js';
|
|
31
31
|
|
|
32
32
|
const [ts, dts] = tsConfig;
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
export default defineConfig([
|
|
35
35
|
baseConfig,
|
|
36
36
|
{
|
|
37
37
|
...ts,
|
|
@@ -39,5 +39,4 @@ module.exports = defineConfig([
|
|
|
39
39
|
},
|
|
40
40
|
dts,
|
|
41
41
|
vue3Config,
|
|
42
|
-
prettierConfig,
|
|
43
42
|
]);
|