@dhzh/eslint-config 0.24.0 → 0.26.0
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/README.md +4 -0
- package/dist/cli.cjs +16 -16
- package/dist/cli.js +16 -16
- package/dist/index.cjs +2 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,6 +53,10 @@ Differences from [@antfu/eslint-config](https://github.com/antfu/eslint-config/b
|
|
|
53
53
|
|
|
54
54
|
11. Keep auto fix with code editors for rules: [`prefer-const`](https://eslint.org/docs/rules/prefer-const), [`unused-imports/no-unused-imports`](https://www.npmjs.com/package/eslint-plugin-unused-imports).
|
|
55
55
|
|
|
56
|
+
12. Disable [`perfectionist/sort-objects`](https://perfectionist.dev/rules/sort-objects) rule.
|
|
57
|
+
|
|
58
|
+
13. Disable [`jsonc/sort-keys`](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/sort-keys.html) rule.
|
|
59
|
+
|
|
56
60
|
## Usage
|
|
57
61
|
|
|
58
62
|
> Requires ESLint v9.5.0+
|
package/dist/cli.cjs
CHANGED
|
@@ -40,7 +40,7 @@ var import_ansis = __toESM(require("ansis"), 1);
|
|
|
40
40
|
var package_default = {
|
|
41
41
|
name: "@dhzh/eslint-config",
|
|
42
42
|
type: "module",
|
|
43
|
-
version: "0.
|
|
43
|
+
version: "0.26.0",
|
|
44
44
|
packageManager: "pnpm@10.6.1",
|
|
45
45
|
description: "Lyle's ESLint config",
|
|
46
46
|
author: "Lyle Zheng <dhzhme@gmail.com>",
|
|
@@ -592,16 +592,13 @@ async function run(options = {}) {
|
|
|
592
592
|
};
|
|
593
593
|
if (!argSkipPrompt) {
|
|
594
594
|
result = await p4.group({
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
return;
|
|
595
|
+
uncommittedConfirmed: () => {
|
|
596
|
+
if (argSkipPrompt || isGitClean()) {
|
|
597
|
+
return Promise.resolve(true);
|
|
599
598
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
message:
|
|
603
|
-
options: extraOptions,
|
|
604
|
-
required: false
|
|
599
|
+
return p4.confirm({
|
|
600
|
+
initialValue: false,
|
|
601
|
+
message: "There are uncommitted changes in the current repository, are you sure to continue?"
|
|
605
602
|
});
|
|
606
603
|
},
|
|
607
604
|
frameworks: ({ results }) => {
|
|
@@ -616,13 +613,16 @@ async function run(options = {}) {
|
|
|
616
613
|
required: false
|
|
617
614
|
});
|
|
618
615
|
},
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
616
|
+
extra: ({ results }) => {
|
|
617
|
+
const isArgExtraValid = argExtra?.length && !argExtra.filter((element) => !extra.includes(element)).length;
|
|
618
|
+
if (!results.uncommittedConfirmed || isArgExtraValid) {
|
|
619
|
+
return;
|
|
622
620
|
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
message:
|
|
621
|
+
const message = !isArgExtraValid && argExtra ? `"${argExtra}" isn't a valid extra util. Please choose from below: ` : "Select a extra utils:";
|
|
622
|
+
return p4.multiselect({
|
|
623
|
+
message: import_ansis5.default.reset(message),
|
|
624
|
+
options: extraOptions,
|
|
625
|
+
required: false
|
|
626
626
|
});
|
|
627
627
|
},
|
|
628
628
|
updateVscodeSettings: ({ results }) => {
|
package/dist/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ import c from "ansis";
|
|
|
11
11
|
var package_default = {
|
|
12
12
|
name: "@dhzh/eslint-config",
|
|
13
13
|
type: "module",
|
|
14
|
-
version: "0.
|
|
14
|
+
version: "0.26.0",
|
|
15
15
|
packageManager: "pnpm@10.6.1",
|
|
16
16
|
description: "Lyle's ESLint config",
|
|
17
17
|
author: "Lyle Zheng <dhzhme@gmail.com>",
|
|
@@ -563,16 +563,13 @@ async function run(options = {}) {
|
|
|
563
563
|
};
|
|
564
564
|
if (!argSkipPrompt) {
|
|
565
565
|
result = await p4.group({
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
return;
|
|
566
|
+
uncommittedConfirmed: () => {
|
|
567
|
+
if (argSkipPrompt || isGitClean()) {
|
|
568
|
+
return Promise.resolve(true);
|
|
570
569
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
message:
|
|
574
|
-
options: extraOptions,
|
|
575
|
-
required: false
|
|
570
|
+
return p4.confirm({
|
|
571
|
+
initialValue: false,
|
|
572
|
+
message: "There are uncommitted changes in the current repository, are you sure to continue?"
|
|
576
573
|
});
|
|
577
574
|
},
|
|
578
575
|
frameworks: ({ results }) => {
|
|
@@ -587,13 +584,16 @@ async function run(options = {}) {
|
|
|
587
584
|
required: false
|
|
588
585
|
});
|
|
589
586
|
},
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
587
|
+
extra: ({ results }) => {
|
|
588
|
+
const isArgExtraValid = argExtra?.length && !argExtra.filter((element) => !extra.includes(element)).length;
|
|
589
|
+
if (!results.uncommittedConfirmed || isArgExtraValid) {
|
|
590
|
+
return;
|
|
593
591
|
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
message:
|
|
592
|
+
const message = !isArgExtraValid && argExtra ? `"${argExtra}" isn't a valid extra util. Please choose from below: ` : "Select a extra utils:";
|
|
593
|
+
return p4.multiselect({
|
|
594
|
+
message: c4.reset(message),
|
|
595
|
+
options: extraOptions,
|
|
596
|
+
required: false
|
|
597
597
|
});
|
|
598
598
|
},
|
|
599
599
|
updateVscodeSettings: ({ results }) => {
|
package/dist/index.cjs
CHANGED
|
@@ -1144,6 +1144,7 @@ async function jsonc(options = {}) {
|
|
|
1144
1144
|
"jsonc/space-unary-ops": "error",
|
|
1145
1145
|
"jsonc/valid-json-number": "error",
|
|
1146
1146
|
"jsonc/vue-custom-block/no-parsing-error": "error",
|
|
1147
|
+
"jsonc/sort-keys": "off",
|
|
1147
1148
|
...stylistic2 ? {
|
|
1148
1149
|
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
1149
1150
|
"jsonc/comma-dangle": ["error", "never"],
|
|
@@ -1290,6 +1291,7 @@ async function perfectionist() {
|
|
|
1290
1291
|
perfectionist: import_eslint_plugin_perfectionist.default
|
|
1291
1292
|
},
|
|
1292
1293
|
rules: {
|
|
1294
|
+
"perfectionist/sort-objects": ["off"],
|
|
1293
1295
|
"perfectionist/sort-exports": ["off", { order: "asc", type: "natural" }],
|
|
1294
1296
|
"perfectionist/sort-imports": ["off", {
|
|
1295
1297
|
groups: [
|
package/dist/index.js
CHANGED
|
@@ -1030,6 +1030,7 @@ async function jsonc(options = {}) {
|
|
|
1030
1030
|
"jsonc/space-unary-ops": "error",
|
|
1031
1031
|
"jsonc/valid-json-number": "error",
|
|
1032
1032
|
"jsonc/vue-custom-block/no-parsing-error": "error",
|
|
1033
|
+
"jsonc/sort-keys": "off",
|
|
1033
1034
|
...stylistic2 ? {
|
|
1034
1035
|
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
1035
1036
|
"jsonc/comma-dangle": ["error", "never"],
|
|
@@ -1176,6 +1177,7 @@ async function perfectionist() {
|
|
|
1176
1177
|
perfectionist: default5
|
|
1177
1178
|
},
|
|
1178
1179
|
rules: {
|
|
1180
|
+
"perfectionist/sort-objects": ["off"],
|
|
1179
1181
|
"perfectionist/sort-exports": ["off", { order: "asc", type: "natural" }],
|
|
1180
1182
|
"perfectionist/sort-imports": ["off", {
|
|
1181
1183
|
groups: [
|