@blueking/bkui-lint 0.0.3 → 0.0.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.
Files changed (2) hide show
  1. package/eslint.js +30 -19
  2. package/package.json +9 -9
package/eslint.js CHANGED
@@ -10,6 +10,9 @@ const perfectionist = require('eslint-plugin-perfectionist');
10
10
  const eslintVuePlugin = require('eslint-plugin-vue');
11
11
  const { rules: tencentEslintLegacyRules } = require('eslint-config-tencent/ts');
12
12
  const prettierConfig = require('./prettier');
13
+ const OFF = 0;
14
+ // const WARNING = 1;
15
+ const ERROR = 2;
13
16
  // deprecating formatting rules https://typescript-eslint.io/blog/deprecating-formatting-rules
14
17
  const deprecateRules = Object.fromEntries(
15
18
  [
@@ -34,7 +37,7 @@ const deprecateRules = Object.fromEntries(
34
37
  'space-before-function-paren',
35
38
  'space-infix-ops',
36
39
  'type-annotation-spacing',
37
- ].map(rule => [`@typescript-eslint/${rule}`, 'off']),
40
+ ].map(rule => [`@typescript-eslint/${rule}`, OFF]),
38
41
  );
39
42
  const jsxOrVueSortGroups = {
40
43
  'custom-groups': {
@@ -81,7 +84,7 @@ module.exports = [
81
84
  plugins: { perfectionist },
82
85
  rules: {
83
86
  'perfectionist/sort-classes': [
84
- 'error',
87
+ ERROR,
85
88
  {
86
89
  groups: [
87
90
  'decorated-accessor-property',
@@ -108,7 +111,7 @@ module.exports = [
108
111
  },
109
112
  ],
110
113
  // 'perfectionist/sort-objects': [
111
- // 'error',
114
+ // ERROR,
112
115
  // {
113
116
  // 'custom-groups': {
114
117
  // ID: '*(id|ID|Id)',
@@ -133,21 +136,21 @@ module.exports = [
133
136
  plugins: { perfectionist },
134
137
  rules: {
135
138
  'perfectionist/sort-enums': [
136
- 'error',
139
+ ERROR,
137
140
  {
138
141
  order: 'asc',
139
142
  type: 'natural',
140
143
  },
141
144
  ],
142
145
  'perfectionist/sort-exports': [
143
- 'error',
146
+ ERROR,
144
147
  {
145
148
  order: 'asc',
146
149
  type: 'natural',
147
150
  },
148
151
  ],
149
152
  'perfectionist/sort-imports': [
150
- 'error',
153
+ ERROR,
151
154
  {
152
155
  'custom-groups': {
153
156
  type: {
@@ -181,7 +184,7 @@ module.exports = [
181
184
  },
182
185
  ],
183
186
  'perfectionist/sort-jsx-props': [
184
- 'error',
187
+ ERROR,
185
188
  {
186
189
  ...jsxOrVueSortGroups,
187
190
  order: 'asc',
@@ -189,28 +192,28 @@ module.exports = [
189
192
  },
190
193
  ],
191
194
  'perfectionist/sort-maps': [
192
- 'error',
195
+ ERROR,
193
196
  {
194
197
  order: 'asc',
195
198
  type: 'natural',
196
199
  },
197
200
  ],
198
201
  // 'perfectionist/sort-intersection-types': [
199
- // 'error',
202
+ // ERROR,
200
203
  // {
201
204
  // type: 'natural',
202
205
  // order: 'asc',
203
206
  // },
204
207
  // ],
205
208
  'perfectionist/sort-union-types': [
206
- 'error',
209
+ ERROR,
207
210
  {
208
211
  order: 'asc',
209
212
  type: 'natural',
210
213
  },
211
214
  ],
212
215
  'perfectionist/sort-vue-attributes': [
213
- 'error',
216
+ ERROR,
214
217
  {
215
218
  ...jsxOrVueSortGroups,
216
219
  type: 'natural',
@@ -224,7 +227,7 @@ module.exports = [
224
227
  rules: {
225
228
  ...prettier.configs.recommended.rules,
226
229
  'prettier/prettier': [
227
- 'error',
230
+ ERROR,
228
231
  {
229
232
  ...prettierConfig,
230
233
  },
@@ -247,7 +250,7 @@ module.exports = [
247
250
  },
248
251
  rules: {
249
252
  'codecc/license': [
250
- 'error',
253
+ ERROR,
251
254
  {
252
255
  license: `/*
253
256
  * Tencent is pleased to support the open source community by making
@@ -280,6 +283,14 @@ module.exports = [
280
283
  ...typescriptEslint.configs.recommended.rules,
281
284
  ...tencentEslintLegacyRules,
282
285
  ...deprecateRules,
286
+ '@typescript-eslint/consistent-type-imports': [
287
+ ERROR,
288
+ {
289
+ prefer: 'type-imports',
290
+ disallowTypeAnnotations: true,
291
+ fixStyle: 'inline-type-imports',
292
+ },
293
+ ],
283
294
  },
284
295
  },
285
296
  ...eslintVuePlugin.configs['flat/recommended'].map(config =>
@@ -308,8 +319,8 @@ module.exports = [
308
319
  rules: {
309
320
  ...config.rules,
310
321
  ...tencentEslintLegacyRules,
311
- '@typescript-eslint/explicit-member-accessibility': 'off',
312
- 'comma-dangle': ['error', 'always-multiline'],
322
+ '@typescript-eslint/explicit-member-accessibility': OFF,
323
+ 'comma-dangle': [ERROR, 'always-multiline'],
313
324
  ...deprecateRules,
314
325
  },
315
326
  }
@@ -317,13 +328,13 @@ module.exports = [
317
328
  ),
318
329
  {
319
330
  rules: {
320
- 'vue/html-self-closing': 'off',
321
- 'vue/require-default-prop': 'off',
322
- 'vue/attributes-order': 'off',
331
+ 'vue/html-self-closing': OFF,
332
+ 'vue/require-default-prop': OFF,
333
+ 'vue/attributes-order': OFF,
323
334
  },
324
335
  },
325
336
  eslintConfigPrettier,
326
337
  {
327
- ignores: ['node_modules'],
338
+ ignores: ['**/node_modules/'],
328
339
  },
329
340
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/bkui-lint",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "蓝鲸监控平台公共lint工具",
5
5
  "license": "MIT",
6
6
  "author": "Tencent BlueKing",
@@ -15,26 +15,26 @@
15
15
  "registry": "https://registry.npmjs.org/"
16
16
  },
17
17
  "dependencies": {
18
- "@typescript-eslint/eslint-plugin": "^7.8.0",
19
- "@typescript-eslint/parser": "^7.8.0",
20
- "eslint": "^9.2.0",
18
+ "@typescript-eslint/eslint-plugin": "^7.12.0",
19
+ "@typescript-eslint/parser": "^7.12.0",
20
+ "eslint": "^9.4.0",
21
21
  "eslint-config-prettier": "^9.1.0",
22
22
  "eslint-config-tencent": "^1.0.4",
23
- "eslint-plugin-codecc": "^1.0.0-beta.1",
23
+ "eslint-plugin-codecc": "1.0.0-beta.1",
24
24
  "eslint-plugin-perfectionist": "^2.10.0",
25
25
  "eslint-plugin-prettier": "^5.1.3",
26
26
  "eslint-plugin-vue": "^9.26.0",
27
27
  "postcss-html": "^1.7.0",
28
28
  "postcss-less": "^6.0.0",
29
29
  "postcss-scss": "^4.0.9",
30
- "prettier": "^3.2.5",
31
- "stylelint": "^16.5.0",
30
+ "prettier": "^3.3.1",
31
+ "stylelint": "^16.6.1",
32
32
  "stylelint-config-recess-order": "^5.0.1",
33
33
  "stylelint-config-recommended-vue": "^1.5.0",
34
34
  "stylelint-config-standard": "^36.0.0",
35
35
  "stylelint-order": "^6.0.4",
36
- "stylelint-scss": "^6.3.0",
37
- "vue-eslint-parser": "^9.4.2"
36
+ "stylelint-scss": "^6.3.1",
37
+ "vue-eslint-parser": "^9.4.3"
38
38
  },
39
39
  "scripts": {}
40
40
  }