@cuiqg/eslint-config 2.1.24 → 2.1.26
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 +109 -55
- package/dist/index.js +102 -52
- package/package.json +6 -5
package/dist/index.cjs
CHANGED
|
@@ -27,8 +27,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
29
|
// src/index.js
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
30
|
+
var index_exports = {};
|
|
31
|
+
__export(index_exports, {
|
|
32
32
|
GLOB_CSS: () => GLOB_CSS,
|
|
33
33
|
GLOB_EXCLUDE: () => GLOB_EXCLUDE,
|
|
34
34
|
GLOB_HTML: () => GLOB_HTML,
|
|
@@ -43,14 +43,17 @@ __export(src_exports, {
|
|
|
43
43
|
GLOB_SRC: () => GLOB_SRC,
|
|
44
44
|
GLOB_SRC_EXT: () => GLOB_SRC_EXT,
|
|
45
45
|
GLOB_STYLE: () => GLOB_STYLE,
|
|
46
|
+
GLOB_TOML: () => GLOB_TOML,
|
|
46
47
|
GLOB_VUE: () => GLOB_VUE,
|
|
47
48
|
GLOB_XML: () => GLOB_XML,
|
|
48
49
|
GLOB_YAML: () => GLOB_YAML,
|
|
49
50
|
autoImport: () => autoImport,
|
|
50
51
|
comments: () => comments,
|
|
51
52
|
cuiqg: () => cuiqg,
|
|
52
|
-
default: () =>
|
|
53
|
+
default: () => index_default,
|
|
53
54
|
defaultPluginRenaming: () => defaultPluginRenaming,
|
|
55
|
+
disables: () => disables,
|
|
56
|
+
gitignore: () => gitignore,
|
|
54
57
|
hasUnocss: () => hasUnocss,
|
|
55
58
|
hasVue: () => hasVue,
|
|
56
59
|
ignores: () => ignores,
|
|
@@ -60,18 +63,19 @@ __export(src_exports, {
|
|
|
60
63
|
javascript: () => javascript,
|
|
61
64
|
jsdoc: () => jsdoc,
|
|
62
65
|
jsonc: () => jsonc,
|
|
66
|
+
macros: () => macros,
|
|
63
67
|
node: () => node,
|
|
64
|
-
perfectionist: () => perfectionist,
|
|
65
68
|
prettier: () => prettier,
|
|
66
69
|
sortJsconfig: () => sortJsconfig,
|
|
67
70
|
sortPackageJson: () => sortPackageJson,
|
|
68
71
|
stylistic: () => stylistic,
|
|
72
|
+
toml: () => toml,
|
|
69
73
|
unicorn: () => unicorn,
|
|
70
74
|
unocss: () => unocss,
|
|
71
75
|
vue: () => vue,
|
|
72
76
|
yaml: () => yaml
|
|
73
77
|
});
|
|
74
|
-
module.exports = __toCommonJS(
|
|
78
|
+
module.exports = __toCommonJS(index_exports);
|
|
75
79
|
|
|
76
80
|
// src/presets.js
|
|
77
81
|
var import_eslint_flat_config_utils = require("eslint-flat-config-utils");
|
|
@@ -117,6 +121,7 @@ var GLOB_VUE = "**/*.vue";
|
|
|
117
121
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
118
122
|
var GLOB_XML = "**/*.xml";
|
|
119
123
|
var GLOB_HTML = "**/*.htm?(l)";
|
|
124
|
+
var GLOB_TOML = "**/*.toml";
|
|
120
125
|
var GLOB_EXCLUDE = [
|
|
121
126
|
"**/node_modules",
|
|
122
127
|
"**/dist",
|
|
@@ -198,6 +203,7 @@ var hasUnocss = (0, import_local_pkg.isPackageExists)("unocss") || (0, import_lo
|
|
|
198
203
|
async function javascript() {
|
|
199
204
|
return [
|
|
200
205
|
{
|
|
206
|
+
name: "cuiqg/javascript",
|
|
201
207
|
languageOptions: {
|
|
202
208
|
ecmaVersion: 2022,
|
|
203
209
|
globals: {
|
|
@@ -220,7 +226,6 @@ async function javascript() {
|
|
|
220
226
|
linterOptions: {
|
|
221
227
|
reportUnusedDisableDirectives: true
|
|
222
228
|
},
|
|
223
|
-
name: "cuiqg/javascript",
|
|
224
229
|
rules: {
|
|
225
230
|
"accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
|
|
226
231
|
"array-callback-return": "error",
|
|
@@ -371,13 +376,6 @@ async function javascript() {
|
|
|
371
376
|
"vars-on-top": "error",
|
|
372
377
|
"yoda": ["error", "never"]
|
|
373
378
|
}
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
files: [`**/scripts/${GLOB_SRC}`, `**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
|
|
377
|
-
name: "cuiqg/javascript/disables",
|
|
378
|
-
rules: {
|
|
379
|
-
"no-console": "off"
|
|
380
|
-
}
|
|
381
379
|
}
|
|
382
380
|
];
|
|
383
381
|
}
|
|
@@ -385,14 +383,16 @@ async function javascript() {
|
|
|
385
383
|
// src/configs/jsdoc.js
|
|
386
384
|
async function jsdoc() {
|
|
387
385
|
const pluginJsdoc = await interopDefault(import("eslint-plugin-jsdoc"));
|
|
386
|
+
const files = [GLOB_JS];
|
|
388
387
|
return [
|
|
389
388
|
{
|
|
389
|
+
files,
|
|
390
390
|
name: "cuiqg/jsdoc",
|
|
391
391
|
plugins: {
|
|
392
392
|
jsdoc: pluginJsdoc
|
|
393
393
|
},
|
|
394
394
|
rules: {
|
|
395
|
-
...pluginJsdoc.configs
|
|
395
|
+
...pluginJsdoc.configs["flat/recommended"].rules
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
];
|
|
@@ -455,35 +455,38 @@ async function node() {
|
|
|
455
455
|
];
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
// src/configs/
|
|
459
|
-
async function
|
|
460
|
-
const pluginPerfectionist = await interopDefault(import("eslint-plugin-perfectionist"));
|
|
458
|
+
// src/configs/macros.js
|
|
459
|
+
async function macros() {
|
|
461
460
|
return [
|
|
462
461
|
{
|
|
463
|
-
name: "cuiqg/
|
|
464
|
-
|
|
465
|
-
|
|
462
|
+
name: "cuiqg/macros",
|
|
463
|
+
languageOptions: {
|
|
464
|
+
globals: {
|
|
465
|
+
$: "readonly",
|
|
466
|
+
$$: "readonly",
|
|
467
|
+
$computed: "readonly",
|
|
468
|
+
$customRef: "readonly",
|
|
469
|
+
$defineModels: "readonly",
|
|
470
|
+
$defineProps: "readonly",
|
|
471
|
+
$definePropsRefs: "readonly",
|
|
472
|
+
$ref: "readonly",
|
|
473
|
+
$shallowRef: "readonly",
|
|
474
|
+
$toRef: "readonly",
|
|
475
|
+
defineEmit: "readonly",
|
|
476
|
+
defineModels: "readonly",
|
|
477
|
+
defineOptions: "readonly",
|
|
478
|
+
defineProp: "readonly",
|
|
479
|
+
defineProps: "readonly",
|
|
480
|
+
defineRender: "readonly",
|
|
481
|
+
defineSetupComponent: "readonly",
|
|
482
|
+
defineSlots: "readonly"
|
|
483
|
+
}
|
|
466
484
|
},
|
|
467
485
|
rules: {
|
|
468
|
-
"
|
|
469
|
-
"
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
["parent-type", "sibling-type", "index-type", "internal-type"],
|
|
473
|
-
"builtin",
|
|
474
|
-
"external",
|
|
475
|
-
"internal",
|
|
476
|
-
["parent", "sibling", "index"],
|
|
477
|
-
"side-effect",
|
|
478
|
-
"object",
|
|
479
|
-
"unknown"
|
|
480
|
-
],
|
|
481
|
-
newlinesBetween: "ignore",
|
|
482
|
-
order: "asc",
|
|
483
|
-
type: "natural"
|
|
484
|
-
}],
|
|
485
|
-
"perfectionist/sort-named-exports": ["error", { order: "asc", type: "natural" }],
|
|
486
|
-
"perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }]
|
|
486
|
+
"vue/no-export-in-script-setup": "off",
|
|
487
|
+
"vue/valid-attribute-name": "off",
|
|
488
|
+
"vue/valid-define-props": "off",
|
|
489
|
+
"vue/valid-v-bind": "off"
|
|
487
490
|
}
|
|
488
491
|
}
|
|
489
492
|
];
|
|
@@ -996,15 +999,56 @@ async function yaml() {
|
|
|
996
999
|
parser: parserYaml
|
|
997
1000
|
},
|
|
998
1001
|
rules: {
|
|
999
|
-
...pluginYaml.configs.
|
|
1000
|
-
...pluginYaml.configs.prettier.rules
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1002
|
+
...pluginYaml.configs.recommended.rules,
|
|
1003
|
+
...pluginYaml.configs.prettier.rules
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
];
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
// src/configs/gitignore.js
|
|
1010
|
+
async function gitignore() {
|
|
1011
|
+
const pluginGitignore = await interopDefault(import("eslint-config-flat-gitignore"));
|
|
1012
|
+
return [
|
|
1013
|
+
pluginGitignore({
|
|
1014
|
+
name: "cuiqg/gitignore",
|
|
1015
|
+
strict: false
|
|
1016
|
+
})
|
|
1017
|
+
];
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
// src/configs/disables.js
|
|
1021
|
+
async function disables() {
|
|
1022
|
+
return [
|
|
1023
|
+
{
|
|
1024
|
+
files: [`**/scripts/${GLOB_SRC}`, `**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
|
|
1025
|
+
name: "cuiqg/disables",
|
|
1026
|
+
rules: {
|
|
1027
|
+
"no-console": "off"
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
];
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
// src/configs/toml.js
|
|
1034
|
+
async function toml() {
|
|
1035
|
+
const files = [GLOB_TOML];
|
|
1036
|
+
const [pluginToml, parserToml] = await Promise.all([
|
|
1037
|
+
interopDefault(import("eslint-plugin-toml")),
|
|
1038
|
+
interopDefault(import("toml-eslint-parser"))
|
|
1039
|
+
]);
|
|
1040
|
+
return [
|
|
1041
|
+
{
|
|
1042
|
+
name: "cuiqg/toml",
|
|
1043
|
+
files,
|
|
1044
|
+
plugins: {
|
|
1045
|
+
toml: pluginToml
|
|
1046
|
+
},
|
|
1047
|
+
languageOptions: {
|
|
1048
|
+
parser: parserToml
|
|
1049
|
+
},
|
|
1050
|
+
rules: {
|
|
1051
|
+
...pluginToml.configs.recommended.rules
|
|
1008
1052
|
}
|
|
1009
1053
|
}
|
|
1010
1054
|
];
|
|
@@ -1020,6 +1064,7 @@ var defaultPluginRenaming = {
|
|
|
1020
1064
|
function cuiqg(options = {}, ...userConfigs) {
|
|
1021
1065
|
const {
|
|
1022
1066
|
prettier: enablePrettier = false,
|
|
1067
|
+
gitignore: enableGitignore = true,
|
|
1023
1068
|
unocss: enableUnocss = hasUnocss,
|
|
1024
1069
|
vue: enableVue = hasVue,
|
|
1025
1070
|
stylistic: enableStylistic = true,
|
|
@@ -1034,12 +1079,19 @@ function cuiqg(options = {}, ...userConfigs) {
|
|
|
1034
1079
|
node(),
|
|
1035
1080
|
imports(),
|
|
1036
1081
|
unicorn(),
|
|
1037
|
-
|
|
1082
|
+
macros(),
|
|
1038
1083
|
jsonc(),
|
|
1039
1084
|
sortPackageJson(),
|
|
1040
1085
|
sortJsconfig(),
|
|
1041
|
-
yaml()
|
|
1086
|
+
yaml(),
|
|
1087
|
+
toml(),
|
|
1088
|
+
disables()
|
|
1042
1089
|
);
|
|
1090
|
+
if (enableGitignore) {
|
|
1091
|
+
configs.push(
|
|
1092
|
+
gitignore()
|
|
1093
|
+
);
|
|
1094
|
+
}
|
|
1043
1095
|
if (enableStylistic) {
|
|
1044
1096
|
configs.push(
|
|
1045
1097
|
stylistic()
|
|
@@ -1065,13 +1117,11 @@ function cuiqg(options = {}, ...userConfigs) {
|
|
|
1065
1117
|
jsdoc()
|
|
1066
1118
|
);
|
|
1067
1119
|
}
|
|
1068
|
-
|
|
1069
|
-
composer = composer.append(...configs, ...userConfigs).renamePlugins(defaultPluginRenaming);
|
|
1070
|
-
return composer;
|
|
1120
|
+
return (0, import_eslint_flat_config_utils.composer)(...configs).append(...userConfigs).renamePlugins(defaultPluginRenaming);
|
|
1071
1121
|
}
|
|
1072
1122
|
|
|
1073
1123
|
// src/index.js
|
|
1074
|
-
var
|
|
1124
|
+
var index_default = cuiqg;
|
|
1075
1125
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1076
1126
|
0 && (module.exports = {
|
|
1077
1127
|
GLOB_CSS,
|
|
@@ -1088,6 +1138,7 @@ var src_default = cuiqg;
|
|
|
1088
1138
|
GLOB_SRC,
|
|
1089
1139
|
GLOB_SRC_EXT,
|
|
1090
1140
|
GLOB_STYLE,
|
|
1141
|
+
GLOB_TOML,
|
|
1091
1142
|
GLOB_VUE,
|
|
1092
1143
|
GLOB_XML,
|
|
1093
1144
|
GLOB_YAML,
|
|
@@ -1095,6 +1146,8 @@ var src_default = cuiqg;
|
|
|
1095
1146
|
comments,
|
|
1096
1147
|
cuiqg,
|
|
1097
1148
|
defaultPluginRenaming,
|
|
1149
|
+
disables,
|
|
1150
|
+
gitignore,
|
|
1098
1151
|
hasUnocss,
|
|
1099
1152
|
hasVue,
|
|
1100
1153
|
ignores,
|
|
@@ -1104,12 +1157,13 @@ var src_default = cuiqg;
|
|
|
1104
1157
|
javascript,
|
|
1105
1158
|
jsdoc,
|
|
1106
1159
|
jsonc,
|
|
1160
|
+
macros,
|
|
1107
1161
|
node,
|
|
1108
|
-
perfectionist,
|
|
1109
1162
|
prettier,
|
|
1110
1163
|
sortJsconfig,
|
|
1111
1164
|
sortPackageJson,
|
|
1112
1165
|
stylistic,
|
|
1166
|
+
toml,
|
|
1113
1167
|
unicorn,
|
|
1114
1168
|
unocss,
|
|
1115
1169
|
vue,
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/presets.js
|
|
2
|
-
import {
|
|
2
|
+
import { composer } from "eslint-flat-config-utils";
|
|
3
3
|
|
|
4
4
|
// src/utils.js
|
|
5
5
|
async function interopDefault(m) {
|
|
@@ -42,6 +42,7 @@ var GLOB_VUE = "**/*.vue";
|
|
|
42
42
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
43
43
|
var GLOB_XML = "**/*.xml";
|
|
44
44
|
var GLOB_HTML = "**/*.htm?(l)";
|
|
45
|
+
var GLOB_TOML = "**/*.toml";
|
|
45
46
|
var GLOB_EXCLUDE = [
|
|
46
47
|
"**/node_modules",
|
|
47
48
|
"**/dist",
|
|
@@ -123,6 +124,7 @@ var hasUnocss = isPackageExists("unocss") || isPackageExists("@unocss/webpack")
|
|
|
123
124
|
async function javascript() {
|
|
124
125
|
return [
|
|
125
126
|
{
|
|
127
|
+
name: "cuiqg/javascript",
|
|
126
128
|
languageOptions: {
|
|
127
129
|
ecmaVersion: 2022,
|
|
128
130
|
globals: {
|
|
@@ -145,7 +147,6 @@ async function javascript() {
|
|
|
145
147
|
linterOptions: {
|
|
146
148
|
reportUnusedDisableDirectives: true
|
|
147
149
|
},
|
|
148
|
-
name: "cuiqg/javascript",
|
|
149
150
|
rules: {
|
|
150
151
|
"accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
|
|
151
152
|
"array-callback-return": "error",
|
|
@@ -296,13 +297,6 @@ async function javascript() {
|
|
|
296
297
|
"vars-on-top": "error",
|
|
297
298
|
"yoda": ["error", "never"]
|
|
298
299
|
}
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
files: [`**/scripts/${GLOB_SRC}`, `**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
|
|
302
|
-
name: "cuiqg/javascript/disables",
|
|
303
|
-
rules: {
|
|
304
|
-
"no-console": "off"
|
|
305
|
-
}
|
|
306
300
|
}
|
|
307
301
|
];
|
|
308
302
|
}
|
|
@@ -310,14 +304,16 @@ async function javascript() {
|
|
|
310
304
|
// src/configs/jsdoc.js
|
|
311
305
|
async function jsdoc() {
|
|
312
306
|
const pluginJsdoc = await interopDefault(import("eslint-plugin-jsdoc"));
|
|
307
|
+
const files = [GLOB_JS];
|
|
313
308
|
return [
|
|
314
309
|
{
|
|
310
|
+
files,
|
|
315
311
|
name: "cuiqg/jsdoc",
|
|
316
312
|
plugins: {
|
|
317
313
|
jsdoc: pluginJsdoc
|
|
318
314
|
},
|
|
319
315
|
rules: {
|
|
320
|
-
...pluginJsdoc.configs
|
|
316
|
+
...pluginJsdoc.configs["flat/recommended"].rules
|
|
321
317
|
}
|
|
322
318
|
}
|
|
323
319
|
];
|
|
@@ -380,35 +376,38 @@ async function node() {
|
|
|
380
376
|
];
|
|
381
377
|
}
|
|
382
378
|
|
|
383
|
-
// src/configs/
|
|
384
|
-
async function
|
|
385
|
-
const pluginPerfectionist = await interopDefault(import("eslint-plugin-perfectionist"));
|
|
379
|
+
// src/configs/macros.js
|
|
380
|
+
async function macros() {
|
|
386
381
|
return [
|
|
387
382
|
{
|
|
388
|
-
name: "cuiqg/
|
|
389
|
-
|
|
390
|
-
|
|
383
|
+
name: "cuiqg/macros",
|
|
384
|
+
languageOptions: {
|
|
385
|
+
globals: {
|
|
386
|
+
$: "readonly",
|
|
387
|
+
$$: "readonly",
|
|
388
|
+
$computed: "readonly",
|
|
389
|
+
$customRef: "readonly",
|
|
390
|
+
$defineModels: "readonly",
|
|
391
|
+
$defineProps: "readonly",
|
|
392
|
+
$definePropsRefs: "readonly",
|
|
393
|
+
$ref: "readonly",
|
|
394
|
+
$shallowRef: "readonly",
|
|
395
|
+
$toRef: "readonly",
|
|
396
|
+
defineEmit: "readonly",
|
|
397
|
+
defineModels: "readonly",
|
|
398
|
+
defineOptions: "readonly",
|
|
399
|
+
defineProp: "readonly",
|
|
400
|
+
defineProps: "readonly",
|
|
401
|
+
defineRender: "readonly",
|
|
402
|
+
defineSetupComponent: "readonly",
|
|
403
|
+
defineSlots: "readonly"
|
|
404
|
+
}
|
|
391
405
|
},
|
|
392
406
|
rules: {
|
|
393
|
-
"
|
|
394
|
-
"
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
["parent-type", "sibling-type", "index-type", "internal-type"],
|
|
398
|
-
"builtin",
|
|
399
|
-
"external",
|
|
400
|
-
"internal",
|
|
401
|
-
["parent", "sibling", "index"],
|
|
402
|
-
"side-effect",
|
|
403
|
-
"object",
|
|
404
|
-
"unknown"
|
|
405
|
-
],
|
|
406
|
-
newlinesBetween: "ignore",
|
|
407
|
-
order: "asc",
|
|
408
|
-
type: "natural"
|
|
409
|
-
}],
|
|
410
|
-
"perfectionist/sort-named-exports": ["error", { order: "asc", type: "natural" }],
|
|
411
|
-
"perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }]
|
|
407
|
+
"vue/no-export-in-script-setup": "off",
|
|
408
|
+
"vue/valid-attribute-name": "off",
|
|
409
|
+
"vue/valid-define-props": "off",
|
|
410
|
+
"vue/valid-v-bind": "off"
|
|
412
411
|
}
|
|
413
412
|
}
|
|
414
413
|
];
|
|
@@ -921,15 +920,56 @@ async function yaml() {
|
|
|
921
920
|
parser: parserYaml
|
|
922
921
|
},
|
|
923
922
|
rules: {
|
|
924
|
-
...pluginYaml.configs.
|
|
925
|
-
...pluginYaml.configs.prettier.rules
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
923
|
+
...pluginYaml.configs.recommended.rules,
|
|
924
|
+
...pluginYaml.configs.prettier.rules
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
];
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
// src/configs/gitignore.js
|
|
931
|
+
async function gitignore() {
|
|
932
|
+
const pluginGitignore = await interopDefault(import("eslint-config-flat-gitignore"));
|
|
933
|
+
return [
|
|
934
|
+
pluginGitignore({
|
|
935
|
+
name: "cuiqg/gitignore",
|
|
936
|
+
strict: false
|
|
937
|
+
})
|
|
938
|
+
];
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
// src/configs/disables.js
|
|
942
|
+
async function disables() {
|
|
943
|
+
return [
|
|
944
|
+
{
|
|
945
|
+
files: [`**/scripts/${GLOB_SRC}`, `**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
|
|
946
|
+
name: "cuiqg/disables",
|
|
947
|
+
rules: {
|
|
948
|
+
"no-console": "off"
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
];
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
// src/configs/toml.js
|
|
955
|
+
async function toml() {
|
|
956
|
+
const files = [GLOB_TOML];
|
|
957
|
+
const [pluginToml, parserToml] = await Promise.all([
|
|
958
|
+
interopDefault(import("eslint-plugin-toml")),
|
|
959
|
+
interopDefault(import("toml-eslint-parser"))
|
|
960
|
+
]);
|
|
961
|
+
return [
|
|
962
|
+
{
|
|
963
|
+
name: "cuiqg/toml",
|
|
964
|
+
files,
|
|
965
|
+
plugins: {
|
|
966
|
+
toml: pluginToml
|
|
967
|
+
},
|
|
968
|
+
languageOptions: {
|
|
969
|
+
parser: parserToml
|
|
970
|
+
},
|
|
971
|
+
rules: {
|
|
972
|
+
...pluginToml.configs.recommended.rules
|
|
933
973
|
}
|
|
934
974
|
}
|
|
935
975
|
];
|
|
@@ -945,6 +985,7 @@ var defaultPluginRenaming = {
|
|
|
945
985
|
function cuiqg(options = {}, ...userConfigs) {
|
|
946
986
|
const {
|
|
947
987
|
prettier: enablePrettier = false,
|
|
988
|
+
gitignore: enableGitignore = true,
|
|
948
989
|
unocss: enableUnocss = hasUnocss,
|
|
949
990
|
vue: enableVue = hasVue,
|
|
950
991
|
stylistic: enableStylistic = true,
|
|
@@ -959,12 +1000,19 @@ function cuiqg(options = {}, ...userConfigs) {
|
|
|
959
1000
|
node(),
|
|
960
1001
|
imports(),
|
|
961
1002
|
unicorn(),
|
|
962
|
-
|
|
1003
|
+
macros(),
|
|
963
1004
|
jsonc(),
|
|
964
1005
|
sortPackageJson(),
|
|
965
1006
|
sortJsconfig(),
|
|
966
|
-
yaml()
|
|
1007
|
+
yaml(),
|
|
1008
|
+
toml(),
|
|
1009
|
+
disables()
|
|
967
1010
|
);
|
|
1011
|
+
if (enableGitignore) {
|
|
1012
|
+
configs.push(
|
|
1013
|
+
gitignore()
|
|
1014
|
+
);
|
|
1015
|
+
}
|
|
968
1016
|
if (enableStylistic) {
|
|
969
1017
|
configs.push(
|
|
970
1018
|
stylistic()
|
|
@@ -990,13 +1038,11 @@ function cuiqg(options = {}, ...userConfigs) {
|
|
|
990
1038
|
jsdoc()
|
|
991
1039
|
);
|
|
992
1040
|
}
|
|
993
|
-
|
|
994
|
-
composer = composer.append(...configs, ...userConfigs).renamePlugins(defaultPluginRenaming);
|
|
995
|
-
return composer;
|
|
1041
|
+
return composer(...configs).append(...userConfigs).renamePlugins(defaultPluginRenaming);
|
|
996
1042
|
}
|
|
997
1043
|
|
|
998
1044
|
// src/index.js
|
|
999
|
-
var
|
|
1045
|
+
var index_default = cuiqg;
|
|
1000
1046
|
export {
|
|
1001
1047
|
GLOB_CSS,
|
|
1002
1048
|
GLOB_EXCLUDE,
|
|
@@ -1012,14 +1058,17 @@ export {
|
|
|
1012
1058
|
GLOB_SRC,
|
|
1013
1059
|
GLOB_SRC_EXT,
|
|
1014
1060
|
GLOB_STYLE,
|
|
1061
|
+
GLOB_TOML,
|
|
1015
1062
|
GLOB_VUE,
|
|
1016
1063
|
GLOB_XML,
|
|
1017
1064
|
GLOB_YAML,
|
|
1018
1065
|
autoImport,
|
|
1019
1066
|
comments,
|
|
1020
1067
|
cuiqg,
|
|
1021
|
-
|
|
1068
|
+
index_default as default,
|
|
1022
1069
|
defaultPluginRenaming,
|
|
1070
|
+
disables,
|
|
1071
|
+
gitignore,
|
|
1023
1072
|
hasUnocss,
|
|
1024
1073
|
hasVue,
|
|
1025
1074
|
ignores,
|
|
@@ -1029,12 +1078,13 @@ export {
|
|
|
1029
1078
|
javascript,
|
|
1030
1079
|
jsdoc,
|
|
1031
1080
|
jsonc,
|
|
1081
|
+
macros,
|
|
1032
1082
|
node,
|
|
1033
|
-
perfectionist,
|
|
1034
1083
|
prettier,
|
|
1035
1084
|
sortJsconfig,
|
|
1036
1085
|
sortPackageJson,
|
|
1037
1086
|
stylistic,
|
|
1087
|
+
toml,
|
|
1038
1088
|
unicorn,
|
|
1039
1089
|
unocss,
|
|
1040
1090
|
vue,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cuiqg/eslint-config",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.26",
|
|
4
4
|
"description": "ESLint config preset for @cuiqg",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "tsup",
|
|
28
|
-
"build:inspector": "
|
|
29
|
-
"dev": "tsup --watch
|
|
28
|
+
"build:inspector": "npx @eslint/config-inspector build --config eslint-inspector.config.js",
|
|
29
|
+
"dev": "tsup --watch",
|
|
30
30
|
"lint": "eslint .",
|
|
31
|
-
"
|
|
31
|
+
"lint:inspector": "npx @eslint/config-inspector --config eslint-inspector.config.js --open false",
|
|
32
32
|
"prepack": "npm run build",
|
|
33
33
|
"release": "bumpp && npm publish",
|
|
34
34
|
"prepare": "simple-git-hooks"
|
|
@@ -44,14 +44,15 @@
|
|
|
44
44
|
"eslint-plugin-jsdoc": "^50.4.3",
|
|
45
45
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
46
46
|
"eslint-plugin-n": "^17.11.1",
|
|
47
|
-
"eslint-plugin-perfectionist": "^3.9.1",
|
|
48
47
|
"eslint-plugin-prettier": "^5.2.1",
|
|
48
|
+
"eslint-plugin-toml": "^0.12.0",
|
|
49
49
|
"eslint-plugin-unicorn": "^56.0.0",
|
|
50
50
|
"eslint-plugin-vue": "^9.29.1",
|
|
51
51
|
"eslint-plugin-yml": "^1.14.0",
|
|
52
52
|
"globals": "^15.11.0",
|
|
53
53
|
"jsonc-eslint-parser": "^2.4.0",
|
|
54
54
|
"local-pkg": "^0.5.0",
|
|
55
|
+
"toml-eslint-parser": "^0.10.0",
|
|
55
56
|
"unconfig": "^0.6.0",
|
|
56
57
|
"vue-eslint-parser": "^9.4.3",
|
|
57
58
|
"yaml-eslint-parser": "^1.2.3"
|