@cuiqg/eslint-config 2.1.24 → 2.1.25
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 +73 -44
- package/dist/index.js +68 -41
- package/package.json +4 -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,
|
|
@@ -49,8 +49,10 @@ __export(src_exports, {
|
|
|
49
49
|
autoImport: () => autoImport,
|
|
50
50
|
comments: () => comments,
|
|
51
51
|
cuiqg: () => cuiqg,
|
|
52
|
-
default: () =>
|
|
52
|
+
default: () => index_default,
|
|
53
53
|
defaultPluginRenaming: () => defaultPluginRenaming,
|
|
54
|
+
disables: () => disables,
|
|
55
|
+
gitignore: () => gitignore,
|
|
54
56
|
hasUnocss: () => hasUnocss,
|
|
55
57
|
hasVue: () => hasVue,
|
|
56
58
|
ignores: () => ignores,
|
|
@@ -60,8 +62,8 @@ __export(src_exports, {
|
|
|
60
62
|
javascript: () => javascript,
|
|
61
63
|
jsdoc: () => jsdoc,
|
|
62
64
|
jsonc: () => jsonc,
|
|
65
|
+
macros: () => macros,
|
|
63
66
|
node: () => node,
|
|
64
|
-
perfectionist: () => perfectionist,
|
|
65
67
|
prettier: () => prettier,
|
|
66
68
|
sortJsconfig: () => sortJsconfig,
|
|
67
69
|
sortPackageJson: () => sortPackageJson,
|
|
@@ -71,7 +73,7 @@ __export(src_exports, {
|
|
|
71
73
|
vue: () => vue,
|
|
72
74
|
yaml: () => yaml
|
|
73
75
|
});
|
|
74
|
-
module.exports = __toCommonJS(
|
|
76
|
+
module.exports = __toCommonJS(index_exports);
|
|
75
77
|
|
|
76
78
|
// src/presets.js
|
|
77
79
|
var import_eslint_flat_config_utils = require("eslint-flat-config-utils");
|
|
@@ -371,13 +373,6 @@ async function javascript() {
|
|
|
371
373
|
"vars-on-top": "error",
|
|
372
374
|
"yoda": ["error", "never"]
|
|
373
375
|
}
|
|
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
376
|
}
|
|
382
377
|
];
|
|
383
378
|
}
|
|
@@ -455,35 +450,38 @@ async function node() {
|
|
|
455
450
|
];
|
|
456
451
|
}
|
|
457
452
|
|
|
458
|
-
// src/configs/
|
|
459
|
-
async function
|
|
460
|
-
const pluginPerfectionist = await interopDefault(import("eslint-plugin-perfectionist"));
|
|
453
|
+
// src/configs/macros.js
|
|
454
|
+
async function macros() {
|
|
461
455
|
return [
|
|
462
456
|
{
|
|
463
|
-
name: "cuiqg/
|
|
464
|
-
|
|
465
|
-
|
|
457
|
+
name: "cuiqg/macros",
|
|
458
|
+
languageOptions: {
|
|
459
|
+
globals: {
|
|
460
|
+
$: "readonly",
|
|
461
|
+
$$: "readonly",
|
|
462
|
+
$computed: "readonly",
|
|
463
|
+
$customRef: "readonly",
|
|
464
|
+
$defineModels: "readonly",
|
|
465
|
+
$defineProps: "readonly",
|
|
466
|
+
$definePropsRefs: "readonly",
|
|
467
|
+
$ref: "readonly",
|
|
468
|
+
$shallowRef: "readonly",
|
|
469
|
+
$toRef: "readonly",
|
|
470
|
+
defineEmit: "readonly",
|
|
471
|
+
defineModels: "readonly",
|
|
472
|
+
defineOptions: "readonly",
|
|
473
|
+
defineProp: "readonly",
|
|
474
|
+
defineProps: "readonly",
|
|
475
|
+
defineRender: "readonly",
|
|
476
|
+
defineSetupComponent: "readonly",
|
|
477
|
+
defineSlots: "readonly"
|
|
478
|
+
}
|
|
466
479
|
},
|
|
467
480
|
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" }]
|
|
481
|
+
"vue/no-export-in-script-setup": "off",
|
|
482
|
+
"vue/valid-attribute-name": "off",
|
|
483
|
+
"vue/valid-define-props": "off",
|
|
484
|
+
"vue/valid-v-bind": "off"
|
|
487
485
|
}
|
|
488
486
|
}
|
|
489
487
|
];
|
|
@@ -1010,6 +1008,30 @@ async function yaml() {
|
|
|
1010
1008
|
];
|
|
1011
1009
|
}
|
|
1012
1010
|
|
|
1011
|
+
// src/configs/gitignore.js
|
|
1012
|
+
async function gitignore() {
|
|
1013
|
+
const pluginGitignore = await interopDefault(import("eslint-config-flat-gitignore"));
|
|
1014
|
+
return [
|
|
1015
|
+
pluginGitignore({
|
|
1016
|
+
name: "cuiqg/gitignore",
|
|
1017
|
+
strict: false
|
|
1018
|
+
})
|
|
1019
|
+
];
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
// src/configs/disables.js
|
|
1023
|
+
async function disables() {
|
|
1024
|
+
return [
|
|
1025
|
+
{
|
|
1026
|
+
files: [`**/scripts/${GLOB_SRC}`, `**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
|
|
1027
|
+
name: "cuiqg/disables",
|
|
1028
|
+
rules: {
|
|
1029
|
+
"no-console": "off"
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
];
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1013
1035
|
// src/presets.js
|
|
1014
1036
|
var defaultPluginRenaming = {
|
|
1015
1037
|
"@stylistic": "style",
|
|
@@ -1020,6 +1042,7 @@ var defaultPluginRenaming = {
|
|
|
1020
1042
|
function cuiqg(options = {}, ...userConfigs) {
|
|
1021
1043
|
const {
|
|
1022
1044
|
prettier: enablePrettier = false,
|
|
1045
|
+
gitignore: enableGitignore = true,
|
|
1023
1046
|
unocss: enableUnocss = hasUnocss,
|
|
1024
1047
|
vue: enableVue = hasVue,
|
|
1025
1048
|
stylistic: enableStylistic = true,
|
|
@@ -1034,12 +1057,18 @@ function cuiqg(options = {}, ...userConfigs) {
|
|
|
1034
1057
|
node(),
|
|
1035
1058
|
imports(),
|
|
1036
1059
|
unicorn(),
|
|
1037
|
-
|
|
1060
|
+
macros(),
|
|
1038
1061
|
jsonc(),
|
|
1039
1062
|
sortPackageJson(),
|
|
1040
1063
|
sortJsconfig(),
|
|
1041
|
-
yaml()
|
|
1064
|
+
yaml(),
|
|
1065
|
+
disables()
|
|
1042
1066
|
);
|
|
1067
|
+
if (enableGitignore) {
|
|
1068
|
+
configs.push(
|
|
1069
|
+
gitignore()
|
|
1070
|
+
);
|
|
1071
|
+
}
|
|
1043
1072
|
if (enableStylistic) {
|
|
1044
1073
|
configs.push(
|
|
1045
1074
|
stylistic()
|
|
@@ -1065,13 +1094,11 @@ function cuiqg(options = {}, ...userConfigs) {
|
|
|
1065
1094
|
jsdoc()
|
|
1066
1095
|
);
|
|
1067
1096
|
}
|
|
1068
|
-
|
|
1069
|
-
composer = composer.append(...configs, ...userConfigs).renamePlugins(defaultPluginRenaming);
|
|
1070
|
-
return composer;
|
|
1097
|
+
return (0, import_eslint_flat_config_utils.composer)(...configs).append(...userConfigs).renamePlugins(defaultPluginRenaming);
|
|
1071
1098
|
}
|
|
1072
1099
|
|
|
1073
1100
|
// src/index.js
|
|
1074
|
-
var
|
|
1101
|
+
var index_default = cuiqg;
|
|
1075
1102
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1076
1103
|
0 && (module.exports = {
|
|
1077
1104
|
GLOB_CSS,
|
|
@@ -1095,6 +1122,8 @@ var src_default = cuiqg;
|
|
|
1095
1122
|
comments,
|
|
1096
1123
|
cuiqg,
|
|
1097
1124
|
defaultPluginRenaming,
|
|
1125
|
+
disables,
|
|
1126
|
+
gitignore,
|
|
1098
1127
|
hasUnocss,
|
|
1099
1128
|
hasVue,
|
|
1100
1129
|
ignores,
|
|
@@ -1104,8 +1133,8 @@ var src_default = cuiqg;
|
|
|
1104
1133
|
javascript,
|
|
1105
1134
|
jsdoc,
|
|
1106
1135
|
jsonc,
|
|
1136
|
+
macros,
|
|
1107
1137
|
node,
|
|
1108
|
-
perfectionist,
|
|
1109
1138
|
prettier,
|
|
1110
1139
|
sortJsconfig,
|
|
1111
1140
|
sortPackageJson,
|
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) {
|
|
@@ -296,13 +296,6 @@ async function javascript() {
|
|
|
296
296
|
"vars-on-top": "error",
|
|
297
297
|
"yoda": ["error", "never"]
|
|
298
298
|
}
|
|
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
299
|
}
|
|
307
300
|
];
|
|
308
301
|
}
|
|
@@ -380,35 +373,38 @@ async function node() {
|
|
|
380
373
|
];
|
|
381
374
|
}
|
|
382
375
|
|
|
383
|
-
// src/configs/
|
|
384
|
-
async function
|
|
385
|
-
const pluginPerfectionist = await interopDefault(import("eslint-plugin-perfectionist"));
|
|
376
|
+
// src/configs/macros.js
|
|
377
|
+
async function macros() {
|
|
386
378
|
return [
|
|
387
379
|
{
|
|
388
|
-
name: "cuiqg/
|
|
389
|
-
|
|
390
|
-
|
|
380
|
+
name: "cuiqg/macros",
|
|
381
|
+
languageOptions: {
|
|
382
|
+
globals: {
|
|
383
|
+
$: "readonly",
|
|
384
|
+
$$: "readonly",
|
|
385
|
+
$computed: "readonly",
|
|
386
|
+
$customRef: "readonly",
|
|
387
|
+
$defineModels: "readonly",
|
|
388
|
+
$defineProps: "readonly",
|
|
389
|
+
$definePropsRefs: "readonly",
|
|
390
|
+
$ref: "readonly",
|
|
391
|
+
$shallowRef: "readonly",
|
|
392
|
+
$toRef: "readonly",
|
|
393
|
+
defineEmit: "readonly",
|
|
394
|
+
defineModels: "readonly",
|
|
395
|
+
defineOptions: "readonly",
|
|
396
|
+
defineProp: "readonly",
|
|
397
|
+
defineProps: "readonly",
|
|
398
|
+
defineRender: "readonly",
|
|
399
|
+
defineSetupComponent: "readonly",
|
|
400
|
+
defineSlots: "readonly"
|
|
401
|
+
}
|
|
391
402
|
},
|
|
392
403
|
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" }]
|
|
404
|
+
"vue/no-export-in-script-setup": "off",
|
|
405
|
+
"vue/valid-attribute-name": "off",
|
|
406
|
+
"vue/valid-define-props": "off",
|
|
407
|
+
"vue/valid-v-bind": "off"
|
|
412
408
|
}
|
|
413
409
|
}
|
|
414
410
|
];
|
|
@@ -935,6 +931,30 @@ async function yaml() {
|
|
|
935
931
|
];
|
|
936
932
|
}
|
|
937
933
|
|
|
934
|
+
// src/configs/gitignore.js
|
|
935
|
+
async function gitignore() {
|
|
936
|
+
const pluginGitignore = await interopDefault(import("eslint-config-flat-gitignore"));
|
|
937
|
+
return [
|
|
938
|
+
pluginGitignore({
|
|
939
|
+
name: "cuiqg/gitignore",
|
|
940
|
+
strict: false
|
|
941
|
+
})
|
|
942
|
+
];
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
// src/configs/disables.js
|
|
946
|
+
async function disables() {
|
|
947
|
+
return [
|
|
948
|
+
{
|
|
949
|
+
files: [`**/scripts/${GLOB_SRC}`, `**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
|
|
950
|
+
name: "cuiqg/disables",
|
|
951
|
+
rules: {
|
|
952
|
+
"no-console": "off"
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
];
|
|
956
|
+
}
|
|
957
|
+
|
|
938
958
|
// src/presets.js
|
|
939
959
|
var defaultPluginRenaming = {
|
|
940
960
|
"@stylistic": "style",
|
|
@@ -945,6 +965,7 @@ var defaultPluginRenaming = {
|
|
|
945
965
|
function cuiqg(options = {}, ...userConfigs) {
|
|
946
966
|
const {
|
|
947
967
|
prettier: enablePrettier = false,
|
|
968
|
+
gitignore: enableGitignore = true,
|
|
948
969
|
unocss: enableUnocss = hasUnocss,
|
|
949
970
|
vue: enableVue = hasVue,
|
|
950
971
|
stylistic: enableStylistic = true,
|
|
@@ -959,12 +980,18 @@ function cuiqg(options = {}, ...userConfigs) {
|
|
|
959
980
|
node(),
|
|
960
981
|
imports(),
|
|
961
982
|
unicorn(),
|
|
962
|
-
|
|
983
|
+
macros(),
|
|
963
984
|
jsonc(),
|
|
964
985
|
sortPackageJson(),
|
|
965
986
|
sortJsconfig(),
|
|
966
|
-
yaml()
|
|
987
|
+
yaml(),
|
|
988
|
+
disables()
|
|
967
989
|
);
|
|
990
|
+
if (enableGitignore) {
|
|
991
|
+
configs.push(
|
|
992
|
+
gitignore()
|
|
993
|
+
);
|
|
994
|
+
}
|
|
968
995
|
if (enableStylistic) {
|
|
969
996
|
configs.push(
|
|
970
997
|
stylistic()
|
|
@@ -990,13 +1017,11 @@ function cuiqg(options = {}, ...userConfigs) {
|
|
|
990
1017
|
jsdoc()
|
|
991
1018
|
);
|
|
992
1019
|
}
|
|
993
|
-
|
|
994
|
-
composer = composer.append(...configs, ...userConfigs).renamePlugins(defaultPluginRenaming);
|
|
995
|
-
return composer;
|
|
1020
|
+
return composer(...configs).append(...userConfigs).renamePlugins(defaultPluginRenaming);
|
|
996
1021
|
}
|
|
997
1022
|
|
|
998
1023
|
// src/index.js
|
|
999
|
-
var
|
|
1024
|
+
var index_default = cuiqg;
|
|
1000
1025
|
export {
|
|
1001
1026
|
GLOB_CSS,
|
|
1002
1027
|
GLOB_EXCLUDE,
|
|
@@ -1018,8 +1043,10 @@ export {
|
|
|
1018
1043
|
autoImport,
|
|
1019
1044
|
comments,
|
|
1020
1045
|
cuiqg,
|
|
1021
|
-
|
|
1046
|
+
index_default as default,
|
|
1022
1047
|
defaultPluginRenaming,
|
|
1048
|
+
disables,
|
|
1049
|
+
gitignore,
|
|
1023
1050
|
hasUnocss,
|
|
1024
1051
|
hasVue,
|
|
1025
1052
|
ignores,
|
|
@@ -1029,8 +1056,8 @@ export {
|
|
|
1029
1056
|
javascript,
|
|
1030
1057
|
jsdoc,
|
|
1031
1058
|
jsonc,
|
|
1059
|
+
macros,
|
|
1032
1060
|
node,
|
|
1033
|
-
perfectionist,
|
|
1034
1061
|
prettier,
|
|
1035
1062
|
sortJsconfig,
|
|
1036
1063
|
sortPackageJson,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cuiqg/eslint-config",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.25",
|
|
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,7 +44,6 @@
|
|
|
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",
|
|
49
48
|
"eslint-plugin-unicorn": "^56.0.0",
|
|
50
49
|
"eslint-plugin-vue": "^9.29.1",
|