@deot/dev-eslint 2.9.1 → 2.9.3
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/dist/index.cjs +41 -1
- package/dist/index.js +41 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -10,6 +10,8 @@ const pluginJsdoc = require('eslint-plugin-jsdoc');
|
|
|
10
10
|
const pluginMarkdown = require('eslint-plugin-markdown');
|
|
11
11
|
const pluginImport = require('eslint-plugin-import-x');
|
|
12
12
|
const pluginStylistic = require('@stylistic/eslint-plugin');
|
|
13
|
+
const pluginVue = require('eslint-plugin-vue');
|
|
14
|
+
const parserVue = require('vue-eslint-parser');
|
|
13
15
|
|
|
14
16
|
function _interopNamespaceDefault(e) {
|
|
15
17
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
@@ -362,6 +364,43 @@ const stylistic = async (options$) => {
|
|
|
362
364
|
];
|
|
363
365
|
};
|
|
364
366
|
|
|
367
|
+
const vue = async (options$) => {
|
|
368
|
+
const options = await pickOptions("vue", options$);
|
|
369
|
+
if (!options.enable) {
|
|
370
|
+
return [];
|
|
371
|
+
}
|
|
372
|
+
const essentialRules = pluginVue.configs["essential"].rules;
|
|
373
|
+
const rules = {
|
|
374
|
+
...essentialRules,
|
|
375
|
+
"vue/html-indent": ["error", "tab"],
|
|
376
|
+
"vue/no-multiple-template-root": 0,
|
|
377
|
+
"vue/multi-word-component-names": 0,
|
|
378
|
+
"vue/no-shared-component-data": 0
|
|
379
|
+
};
|
|
380
|
+
return [
|
|
381
|
+
// 单独安装plugins,
|
|
382
|
+
{
|
|
383
|
+
plugins: {
|
|
384
|
+
vue: pluginVue
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
...pluginVue.configs["flat/base"],
|
|
388
|
+
{
|
|
389
|
+
files: ["**/*.vue"],
|
|
390
|
+
languageOptions: {
|
|
391
|
+
parser: parserVue,
|
|
392
|
+
parserOptions: {
|
|
393
|
+
sourceType: "module"
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
rules: {
|
|
397
|
+
...cleanRules("vue", essentialRules, essentialRules, rules),
|
|
398
|
+
...options.overrides
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
];
|
|
402
|
+
};
|
|
403
|
+
|
|
365
404
|
const configure = async (options, ...userConfigs) => {
|
|
366
405
|
const configs = [
|
|
367
406
|
...await ignores(options?.ignores),
|
|
@@ -370,7 +409,8 @@ const configure = async (options, ...userConfigs) => {
|
|
|
370
409
|
...await jsdoc(options),
|
|
371
410
|
...await markdown(options),
|
|
372
411
|
...await imports(options),
|
|
373
|
-
...await stylistic(options)
|
|
412
|
+
...await stylistic(options),
|
|
413
|
+
...await vue(options)
|
|
374
414
|
];
|
|
375
415
|
return configs.concat(userConfigs);
|
|
376
416
|
};
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,8 @@ import pluginJsdoc from 'eslint-plugin-jsdoc';
|
|
|
6
6
|
import pluginMarkdown from 'eslint-plugin-markdown';
|
|
7
7
|
import pluginImport from 'eslint-plugin-import-x';
|
|
8
8
|
import pluginStylistic from '@stylistic/eslint-plugin';
|
|
9
|
+
import pluginVue from 'eslint-plugin-vue';
|
|
10
|
+
import parserVue from 'vue-eslint-parser';
|
|
9
11
|
|
|
10
12
|
const pickOptions = async (key, options) => {
|
|
11
13
|
const configOptions = {
|
|
@@ -339,6 +341,43 @@ const stylistic = async (options$) => {
|
|
|
339
341
|
];
|
|
340
342
|
};
|
|
341
343
|
|
|
344
|
+
const vue = async (options$) => {
|
|
345
|
+
const options = await pickOptions("vue", options$);
|
|
346
|
+
if (!options.enable) {
|
|
347
|
+
return [];
|
|
348
|
+
}
|
|
349
|
+
const essentialRules = pluginVue.configs["essential"].rules;
|
|
350
|
+
const rules = {
|
|
351
|
+
...essentialRules,
|
|
352
|
+
"vue/html-indent": ["error", "tab"],
|
|
353
|
+
"vue/no-multiple-template-root": 0,
|
|
354
|
+
"vue/multi-word-component-names": 0,
|
|
355
|
+
"vue/no-shared-component-data": 0
|
|
356
|
+
};
|
|
357
|
+
return [
|
|
358
|
+
// 单独安装plugins,
|
|
359
|
+
{
|
|
360
|
+
plugins: {
|
|
361
|
+
vue: pluginVue
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
...pluginVue.configs["flat/base"],
|
|
365
|
+
{
|
|
366
|
+
files: ["**/*.vue"],
|
|
367
|
+
languageOptions: {
|
|
368
|
+
parser: parserVue,
|
|
369
|
+
parserOptions: {
|
|
370
|
+
sourceType: "module"
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
rules: {
|
|
374
|
+
...cleanRules("vue", essentialRules, essentialRules, rules),
|
|
375
|
+
...options.overrides
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
];
|
|
379
|
+
};
|
|
380
|
+
|
|
342
381
|
const configure = async (options, ...userConfigs) => {
|
|
343
382
|
const configs = [
|
|
344
383
|
...await ignores(options?.ignores),
|
|
@@ -347,7 +386,8 @@ const configure = async (options, ...userConfigs) => {
|
|
|
347
386
|
...await jsdoc(options),
|
|
348
387
|
...await markdown(options),
|
|
349
388
|
...await imports(options),
|
|
350
|
-
...await stylistic(options)
|
|
389
|
+
...await stylistic(options),
|
|
390
|
+
...await vue(options)
|
|
351
391
|
];
|
|
352
392
|
return configs.concat(userConfigs);
|
|
353
393
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deot/dev-eslint",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"eslint-plugin-import-x": "^4.10.0",
|
|
26
26
|
"eslint-plugin-jsdoc": "^50.6.9",
|
|
27
27
|
"eslint-plugin-markdown": "^5.1.0",
|
|
28
|
+
"eslint-plugin-vue": "^10.0.0",
|
|
28
29
|
"globals": "^16.0.0"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|