@coderwyd/eslint-config 2.6.1 → 2.6.2
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/cli.cjs +16 -16
- package/dist/cli.js +16 -16
- package/dist/index.cjs +49 -40
- package/dist/index.d.cts +194 -188
- package/dist/index.d.ts +194 -188
- package/dist/index.js +49 -40
- package/package.json +11 -11
package/dist/cli.cjs
CHANGED
|
@@ -30,36 +30,27 @@ module.exports = __toCommonJS(cli_exports);
|
|
|
30
30
|
// src/cli/index.ts
|
|
31
31
|
var import_node_process2 = __toESM(require("process"), 1);
|
|
32
32
|
var import_picocolors3 = __toESM(require("picocolors"), 1);
|
|
33
|
-
var import_helpers = require("yargs/helpers");
|
|
34
33
|
var import_yargs = __toESM(require("yargs"), 1);
|
|
35
|
-
|
|
36
|
-
// src/cli/run.ts
|
|
37
|
-
var import_node_fs = __toESM(require("fs"), 1);
|
|
38
|
-
var import_promises = __toESM(require("fs/promises"), 1);
|
|
39
|
-
var import_node_path = __toESM(require("path"), 1);
|
|
40
|
-
var import_node_process = __toESM(require("process"), 1);
|
|
41
|
-
var import_prompts = __toESM(require("prompts"), 1);
|
|
42
|
-
var import_picocolors2 = __toESM(require("picocolors"), 1);
|
|
43
|
-
var import_parse_gitignore = __toESM(require("parse-gitignore"), 1);
|
|
34
|
+
var import_helpers = require("yargs/helpers");
|
|
44
35
|
|
|
45
36
|
// src/cli/constants.ts
|
|
46
37
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
47
38
|
|
|
48
39
|
// package.json
|
|
49
|
-
var version = "2.6.
|
|
40
|
+
var version = "2.6.2";
|
|
50
41
|
var devDependencies = {
|
|
51
42
|
"@antfu/ni": "^0.22.0",
|
|
52
43
|
"@eslint-react/eslint-plugin": "^1.5.30",
|
|
53
44
|
"@eslint/config-inspector": "^0.5.2",
|
|
54
45
|
"@stylistic/eslint-plugin-migrate": "^2.3.0",
|
|
55
|
-
"@types/eslint": "^
|
|
46
|
+
"@types/eslint": "^9.6.0",
|
|
56
47
|
"@types/fs-extra": "^11.0.4",
|
|
57
|
-
"@types/node": "^20.14.
|
|
48
|
+
"@types/node": "^20.14.12",
|
|
58
49
|
"@types/prompts": "^2.4.9",
|
|
59
50
|
"@types/yargs": "^17.0.32",
|
|
60
|
-
"@unocss/eslint-plugin": "^0.61.
|
|
51
|
+
"@unocss/eslint-plugin": "^0.61.6",
|
|
61
52
|
bumpp: "^9.4.1",
|
|
62
|
-
eslint: "^9.
|
|
53
|
+
eslint: "^9.8.0",
|
|
63
54
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
64
55
|
"eslint-plugin-react-refresh": "^0.4.9",
|
|
65
56
|
"eslint-plugin-svelte": "2.43.0",
|
|
@@ -72,7 +63,7 @@ var devDependencies = {
|
|
|
72
63
|
"simple-git-hooks": "^2.11.1",
|
|
73
64
|
svelte: "^4.2.18",
|
|
74
65
|
"svelte-eslint-parser": "^0.41.0",
|
|
75
|
-
tsup: "^8.2.
|
|
66
|
+
tsup: "^8.2.3",
|
|
76
67
|
tsx: "^4.16.2",
|
|
77
68
|
typescript: "^5.5.4"
|
|
78
69
|
};
|
|
@@ -126,6 +117,15 @@ var vscodeSettingsString = `
|
|
|
126
117
|
]
|
|
127
118
|
`;
|
|
128
119
|
|
|
120
|
+
// src/cli/run.ts
|
|
121
|
+
var import_node_fs = __toESM(require("fs"), 1);
|
|
122
|
+
var import_promises = __toESM(require("fs/promises"), 1);
|
|
123
|
+
var import_node_path = __toESM(require("path"), 1);
|
|
124
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
125
|
+
var import_parse_gitignore = __toESM(require("parse-gitignore"), 1);
|
|
126
|
+
var import_picocolors2 = __toESM(require("picocolors"), 1);
|
|
127
|
+
var import_prompts = __toESM(require("prompts"), 1);
|
|
128
|
+
|
|
129
129
|
// src/cli/utils.ts
|
|
130
130
|
var import_node_child_process = require("child_process");
|
|
131
131
|
function isGitClean() {
|
package/dist/cli.js
CHANGED
|
@@ -1,36 +1,27 @@
|
|
|
1
1
|
// src/cli/index.ts
|
|
2
2
|
import process2 from "node:process";
|
|
3
3
|
import c3 from "picocolors";
|
|
4
|
-
import { hideBin } from "yargs/helpers";
|
|
5
4
|
import yargs from "yargs";
|
|
6
|
-
|
|
7
|
-
// src/cli/run.ts
|
|
8
|
-
import fs from "node:fs";
|
|
9
|
-
import fsp from "node:fs/promises";
|
|
10
|
-
import path from "node:path";
|
|
11
|
-
import process from "node:process";
|
|
12
|
-
import prompts from "prompts";
|
|
13
|
-
import c2 from "picocolors";
|
|
14
|
-
import parse from "parse-gitignore";
|
|
5
|
+
import { hideBin } from "yargs/helpers";
|
|
15
6
|
|
|
16
7
|
// src/cli/constants.ts
|
|
17
8
|
import c from "picocolors";
|
|
18
9
|
|
|
19
10
|
// package.json
|
|
20
|
-
var version = "2.6.
|
|
11
|
+
var version = "2.6.2";
|
|
21
12
|
var devDependencies = {
|
|
22
13
|
"@antfu/ni": "^0.22.0",
|
|
23
14
|
"@eslint-react/eslint-plugin": "^1.5.30",
|
|
24
15
|
"@eslint/config-inspector": "^0.5.2",
|
|
25
16
|
"@stylistic/eslint-plugin-migrate": "^2.3.0",
|
|
26
|
-
"@types/eslint": "^
|
|
17
|
+
"@types/eslint": "^9.6.0",
|
|
27
18
|
"@types/fs-extra": "^11.0.4",
|
|
28
|
-
"@types/node": "^20.14.
|
|
19
|
+
"@types/node": "^20.14.12",
|
|
29
20
|
"@types/prompts": "^2.4.9",
|
|
30
21
|
"@types/yargs": "^17.0.32",
|
|
31
|
-
"@unocss/eslint-plugin": "^0.61.
|
|
22
|
+
"@unocss/eslint-plugin": "^0.61.6",
|
|
32
23
|
bumpp: "^9.4.1",
|
|
33
|
-
eslint: "^9.
|
|
24
|
+
eslint: "^9.8.0",
|
|
34
25
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
35
26
|
"eslint-plugin-react-refresh": "^0.4.9",
|
|
36
27
|
"eslint-plugin-svelte": "2.43.0",
|
|
@@ -43,7 +34,7 @@ var devDependencies = {
|
|
|
43
34
|
"simple-git-hooks": "^2.11.1",
|
|
44
35
|
svelte: "^4.2.18",
|
|
45
36
|
"svelte-eslint-parser": "^0.41.0",
|
|
46
|
-
tsup: "^8.2.
|
|
37
|
+
tsup: "^8.2.3",
|
|
47
38
|
tsx: "^4.16.2",
|
|
48
39
|
typescript: "^5.5.4"
|
|
49
40
|
};
|
|
@@ -97,6 +88,15 @@ var vscodeSettingsString = `
|
|
|
97
88
|
]
|
|
98
89
|
`;
|
|
99
90
|
|
|
91
|
+
// src/cli/run.ts
|
|
92
|
+
import fs from "node:fs";
|
|
93
|
+
import fsp from "node:fs/promises";
|
|
94
|
+
import path from "node:path";
|
|
95
|
+
import process from "node:process";
|
|
96
|
+
import parse from "parse-gitignore";
|
|
97
|
+
import c2 from "picocolors";
|
|
98
|
+
import prompts from "prompts";
|
|
99
|
+
|
|
100
100
|
// src/cli/utils.ts
|
|
101
101
|
import { execSync } from "node:child_process";
|
|
102
102
|
function isGitClean() {
|
package/dist/index.cjs
CHANGED
|
@@ -55,7 +55,7 @@ var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-
|
|
|
55
55
|
var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
|
|
56
56
|
|
|
57
57
|
// src/configs/comments.ts
|
|
58
|
-
|
|
58
|
+
function comments() {
|
|
59
59
|
return [
|
|
60
60
|
{
|
|
61
61
|
name: "coderwyd/eslint-comments/rules",
|
|
@@ -137,7 +137,7 @@ var GLOB_EXCLUDE = [
|
|
|
137
137
|
];
|
|
138
138
|
|
|
139
139
|
// src/configs/ignores.ts
|
|
140
|
-
|
|
140
|
+
function ignores() {
|
|
141
141
|
return [
|
|
142
142
|
{
|
|
143
143
|
ignores: GLOB_EXCLUDE
|
|
@@ -146,7 +146,7 @@ async function ignores() {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
// src/configs/imports.ts
|
|
149
|
-
|
|
149
|
+
function imports(options = {}) {
|
|
150
150
|
const { stylistic: stylistic2 = true } = options;
|
|
151
151
|
return [
|
|
152
152
|
{
|
|
@@ -165,23 +165,6 @@ async function imports(options = {}) {
|
|
|
165
165
|
"import/no-named-default": "error",
|
|
166
166
|
"import/no-self-import": "error",
|
|
167
167
|
"import/no-webpack-loader-syntax": "error",
|
|
168
|
-
"import/order": [
|
|
169
|
-
"error",
|
|
170
|
-
{
|
|
171
|
-
groups: [
|
|
172
|
-
"builtin",
|
|
173
|
-
"external",
|
|
174
|
-
"internal",
|
|
175
|
-
"parent",
|
|
176
|
-
"sibling",
|
|
177
|
-
"index",
|
|
178
|
-
"object",
|
|
179
|
-
"type"
|
|
180
|
-
],
|
|
181
|
-
pathGroups: [{ group: "internal", pattern: "{{@,~}/,#}**" }],
|
|
182
|
-
pathGroupsExcludedImportTypes: ["type"]
|
|
183
|
-
}
|
|
184
|
-
],
|
|
185
168
|
...stylistic2 ? {
|
|
186
169
|
"import/newline-after-import": ["error", { count: 1 }]
|
|
187
170
|
} : {}
|
|
@@ -200,7 +183,7 @@ async function imports(options = {}) {
|
|
|
200
183
|
|
|
201
184
|
// src/configs/javascript.ts
|
|
202
185
|
var import_globals = __toESM(require("globals"), 1);
|
|
203
|
-
|
|
186
|
+
function javascript(options = {}) {
|
|
204
187
|
const { isInEditor: isInEditor2 = false, overrides = {} } = options;
|
|
205
188
|
return [
|
|
206
189
|
{
|
|
@@ -406,16 +389,8 @@ async function javascript(options = {}) {
|
|
|
406
389
|
"prefer-rest-params": "error",
|
|
407
390
|
"prefer-spread": "error",
|
|
408
391
|
"prefer-template": "error",
|
|
409
|
-
"
|
|
410
|
-
|
|
411
|
-
{
|
|
412
|
-
allowSeparatedGroups: false,
|
|
413
|
-
ignoreCase: false,
|
|
414
|
-
ignoreDeclarationSort: true,
|
|
415
|
-
ignoreMemberSort: false,
|
|
416
|
-
memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
|
|
417
|
-
}
|
|
418
|
-
],
|
|
392
|
+
"require-await": "error",
|
|
393
|
+
"require-yield": "error",
|
|
419
394
|
"symbol-description": "error",
|
|
420
395
|
"unicode-bom": ["error", "never"],
|
|
421
396
|
"unused-imports/no-unused-imports": isInEditor2 ? "off" : "error",
|
|
@@ -670,7 +645,7 @@ async function jsonc(options = {}) {
|
|
|
670
645
|
}
|
|
671
646
|
|
|
672
647
|
// src/configs/node.ts
|
|
673
|
-
|
|
648
|
+
function node() {
|
|
674
649
|
return [
|
|
675
650
|
{
|
|
676
651
|
name: "coderwyd/node/rules",
|
|
@@ -692,7 +667,7 @@ async function node() {
|
|
|
692
667
|
}
|
|
693
668
|
|
|
694
669
|
// src/configs/sort.ts
|
|
695
|
-
|
|
670
|
+
function sortPackageJson() {
|
|
696
671
|
return [
|
|
697
672
|
{
|
|
698
673
|
files: ["**/package.json"],
|
|
@@ -1140,7 +1115,7 @@ async function typescript(options = {}) {
|
|
|
1140
1115
|
}
|
|
1141
1116
|
|
|
1142
1117
|
// src/configs/unicorn.ts
|
|
1143
|
-
|
|
1118
|
+
function unicorn() {
|
|
1144
1119
|
return [
|
|
1145
1120
|
{
|
|
1146
1121
|
name: "coderwyd/unicorn/rules",
|
|
@@ -1172,6 +1147,7 @@ async function unicorn() {
|
|
|
1172
1147
|
"unicorn/no-hex-escape": "error",
|
|
1173
1148
|
"unicorn/no-instanceof-array": "error",
|
|
1174
1149
|
"unicorn/no-invalid-remove-event-listener": "error",
|
|
1150
|
+
"unicorn/no-length-as-slice-end": "error",
|
|
1175
1151
|
"unicorn/no-lonely-if": "error",
|
|
1176
1152
|
"unicorn/no-new-array": "error",
|
|
1177
1153
|
"unicorn/no-new-buffer": "error",
|
|
@@ -1336,7 +1312,7 @@ async function vue(options = {}) {
|
|
|
1336
1312
|
// },
|
|
1337
1313
|
"vue/html-quotes": ["error", "double"],
|
|
1338
1314
|
// ],
|
|
1339
|
-
|
|
1315
|
+
// 'vue/max-attributes-per-line': 'off',
|
|
1340
1316
|
"vue/multi-word-component-names": "off",
|
|
1341
1317
|
// 'vue/next-tick-style': ['warn', 'promise'],
|
|
1342
1318
|
"vue/no-constant-condition": "warn",
|
|
@@ -1487,12 +1463,45 @@ async function test(options = {}) {
|
|
|
1487
1463
|
}
|
|
1488
1464
|
|
|
1489
1465
|
// src/configs/perfectionist.ts
|
|
1490
|
-
|
|
1466
|
+
function perfectionist() {
|
|
1491
1467
|
return [
|
|
1492
1468
|
{
|
|
1493
|
-
name: "coderwyd/perfectionist/
|
|
1469
|
+
name: "coderwyd/perfectionist/rules",
|
|
1494
1470
|
plugins: {
|
|
1495
1471
|
perfectionist: import_eslint_plugin_perfectionist.default
|
|
1472
|
+
},
|
|
1473
|
+
rules: {
|
|
1474
|
+
"perfectionist/sort-imports": [
|
|
1475
|
+
"warn",
|
|
1476
|
+
{
|
|
1477
|
+
groups: [
|
|
1478
|
+
"builtin",
|
|
1479
|
+
"external",
|
|
1480
|
+
"internal",
|
|
1481
|
+
"internal-type",
|
|
1482
|
+
"parent",
|
|
1483
|
+
"parent-type",
|
|
1484
|
+
"sibling",
|
|
1485
|
+
"sibling-type",
|
|
1486
|
+
"index",
|
|
1487
|
+
"index-type",
|
|
1488
|
+
"object",
|
|
1489
|
+
"type",
|
|
1490
|
+
"side-effect",
|
|
1491
|
+
"side-effect-style"
|
|
1492
|
+
],
|
|
1493
|
+
internalPattern: ["~/**", "@/**", "#**"],
|
|
1494
|
+
newlinesBetween: "ignore"
|
|
1495
|
+
}
|
|
1496
|
+
],
|
|
1497
|
+
"perfectionist/sort-named-exports": [
|
|
1498
|
+
"warn",
|
|
1499
|
+
{ groupKind: "values-first" }
|
|
1500
|
+
],
|
|
1501
|
+
"perfectionist/sort-named-imports": [
|
|
1502
|
+
"warn",
|
|
1503
|
+
{ groupKind: "values-first" }
|
|
1504
|
+
]
|
|
1496
1505
|
}
|
|
1497
1506
|
}
|
|
1498
1507
|
];
|
|
@@ -1905,7 +1914,7 @@ async function tailwindcss(options = {}) {
|
|
|
1905
1914
|
|
|
1906
1915
|
// src/configs/command.ts
|
|
1907
1916
|
var import_config = __toESM(require("eslint-plugin-command/config"), 1);
|
|
1908
|
-
|
|
1917
|
+
function command() {
|
|
1909
1918
|
return [
|
|
1910
1919
|
{
|
|
1911
1920
|
...(0, import_config.default)(),
|
|
@@ -1916,7 +1925,7 @@ async function command() {
|
|
|
1916
1925
|
|
|
1917
1926
|
// src/configs/regexp.ts
|
|
1918
1927
|
var import_eslint_plugin_regexp = require("eslint-plugin-regexp");
|
|
1919
|
-
|
|
1928
|
+
function regexp(options = {}) {
|
|
1920
1929
|
const config = import_eslint_plugin_regexp.configs["flat/recommended"];
|
|
1921
1930
|
const rules = {
|
|
1922
1931
|
...config.rules
|
|
@@ -1940,7 +1949,7 @@ async function regexp(options = {}) {
|
|
|
1940
1949
|
}
|
|
1941
1950
|
|
|
1942
1951
|
// src/configs/jsx.ts
|
|
1943
|
-
|
|
1952
|
+
function jsx() {
|
|
1944
1953
|
return [
|
|
1945
1954
|
{
|
|
1946
1955
|
files: [GLOB_JSX, GLOB_TSX],
|