@coderwyd/eslint-config 2.3.2 → 2.3.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/README.md +4 -2
- package/dist/cli.cjs +10 -9
- package/dist/cli.js +10 -9
- package/dist/index.cjs +44 -41
- package/dist/index.d.cts +12673 -326
- package/dist/index.d.ts +12673 -326
- package/dist/index.js +44 -41
- package/package.json +26 -26
package/README.md
CHANGED
|
@@ -104,16 +104,18 @@ If you want to apply lint and auto-fix before every commit, you can add the foll
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
```
|
|
107
|
+
|
|
107
108
|
and then
|
|
108
109
|
|
|
109
110
|
```bash
|
|
110
111
|
npm i -D lint-staged simple-git-hooks
|
|
111
112
|
```
|
|
113
|
+
|
|
112
114
|
## Options
|
|
113
115
|
|
|
114
116
|
### interface Options
|
|
115
117
|
|
|
116
|
-
|
|
118
|
+
````ts
|
|
117
119
|
interface OptionsConfig {
|
|
118
120
|
/**
|
|
119
121
|
* The current working directory
|
|
@@ -252,7 +254,7 @@ interface OptionsConfig {
|
|
|
252
254
|
*/
|
|
253
255
|
isInEditor?: boolean
|
|
254
256
|
}
|
|
255
|
-
|
|
257
|
+
````
|
|
256
258
|
|
|
257
259
|
## Thanks
|
|
258
260
|
|
package/dist/cli.cjs
CHANGED
|
@@ -46,32 +46,33 @@ var import_parse_gitignore = __toESM(require("parse-gitignore"), 1);
|
|
|
46
46
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
47
47
|
|
|
48
48
|
// package.json
|
|
49
|
-
var version = "2.3.
|
|
49
|
+
var version = "2.3.3";
|
|
50
50
|
var devDependencies = {
|
|
51
51
|
"@antfu/ni": "^0.21.12",
|
|
52
|
-
"@
|
|
52
|
+
"@eslint/config-inspector": "^0.4.1",
|
|
53
|
+
"@types/eslint": "^8.56.7",
|
|
53
54
|
"@types/fs-extra": "^11.0.4",
|
|
54
|
-
"@types/node": "^20.
|
|
55
|
+
"@types/node": "^20.12.5",
|
|
55
56
|
"@types/prompts": "^2.4.9",
|
|
56
57
|
"@types/yargs": "^17.0.32",
|
|
57
|
-
"@unocss/eslint-plugin": "^0.
|
|
58
|
+
"@unocss/eslint-plugin": "^0.59.0",
|
|
58
59
|
bumpp: "^9.4.0",
|
|
59
|
-
eslint: "9.0.0
|
|
60
|
-
"eslint-flat-config-viewer": "^0.1.14",
|
|
60
|
+
eslint: "9.0.0",
|
|
61
61
|
"eslint-plugin-react": "^7.34.1",
|
|
62
62
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
63
63
|
"eslint-plugin-react-refresh": "^0.4.6",
|
|
64
|
-
"eslint-plugin-svelte": "
|
|
64
|
+
"eslint-plugin-svelte": "2.36.0-next.13",
|
|
65
65
|
execa: "^8.0.1",
|
|
66
66
|
"fast-glob": "^3.3.2",
|
|
67
67
|
"fs-extra": "^11.2.0",
|
|
68
68
|
"lint-staged": "^15.2.2",
|
|
69
69
|
rimraf: "^5.0.5",
|
|
70
70
|
"simple-git-hooks": "^2.11.1",
|
|
71
|
+
svelte: "^4.2.12",
|
|
71
72
|
"svelte-eslint-parser": "^0.33.1",
|
|
72
73
|
tsup: "^8.0.2",
|
|
73
|
-
tsx: "^4.7.
|
|
74
|
-
typescript: "^5.4.
|
|
74
|
+
tsx: "^4.7.2",
|
|
75
|
+
typescript: "^5.4.4"
|
|
75
76
|
};
|
|
76
77
|
|
|
77
78
|
// src/cli/constants.ts
|
package/dist/cli.js
CHANGED
|
@@ -17,32 +17,33 @@ import parse from "parse-gitignore";
|
|
|
17
17
|
import c from "picocolors";
|
|
18
18
|
|
|
19
19
|
// package.json
|
|
20
|
-
var version = "2.3.
|
|
20
|
+
var version = "2.3.3";
|
|
21
21
|
var devDependencies = {
|
|
22
22
|
"@antfu/ni": "^0.21.12",
|
|
23
|
-
"@
|
|
23
|
+
"@eslint/config-inspector": "^0.4.1",
|
|
24
|
+
"@types/eslint": "^8.56.7",
|
|
24
25
|
"@types/fs-extra": "^11.0.4",
|
|
25
|
-
"@types/node": "^20.
|
|
26
|
+
"@types/node": "^20.12.5",
|
|
26
27
|
"@types/prompts": "^2.4.9",
|
|
27
28
|
"@types/yargs": "^17.0.32",
|
|
28
|
-
"@unocss/eslint-plugin": "^0.
|
|
29
|
+
"@unocss/eslint-plugin": "^0.59.0",
|
|
29
30
|
bumpp: "^9.4.0",
|
|
30
|
-
eslint: "9.0.0
|
|
31
|
-
"eslint-flat-config-viewer": "^0.1.14",
|
|
31
|
+
eslint: "9.0.0",
|
|
32
32
|
"eslint-plugin-react": "^7.34.1",
|
|
33
33
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
34
34
|
"eslint-plugin-react-refresh": "^0.4.6",
|
|
35
|
-
"eslint-plugin-svelte": "
|
|
35
|
+
"eslint-plugin-svelte": "2.36.0-next.13",
|
|
36
36
|
execa: "^8.0.1",
|
|
37
37
|
"fast-glob": "^3.3.2",
|
|
38
38
|
"fs-extra": "^11.2.0",
|
|
39
39
|
"lint-staged": "^15.2.2",
|
|
40
40
|
rimraf: "^5.0.5",
|
|
41
41
|
"simple-git-hooks": "^2.11.1",
|
|
42
|
+
svelte: "^4.2.12",
|
|
42
43
|
"svelte-eslint-parser": "^0.33.1",
|
|
43
44
|
tsup: "^8.0.2",
|
|
44
|
-
tsx: "^4.7.
|
|
45
|
-
typescript: "^5.4.
|
|
45
|
+
tsx: "^4.7.2",
|
|
46
|
+
typescript: "^5.4.4"
|
|
46
47
|
};
|
|
47
48
|
|
|
48
49
|
// src/cli/constants.ts
|
package/dist/index.cjs
CHANGED
|
@@ -70,7 +70,7 @@ var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfecti
|
|
|
70
70
|
async function comments() {
|
|
71
71
|
return [
|
|
72
72
|
{
|
|
73
|
-
name: "coderwyd
|
|
73
|
+
name: "coderwyd/eslint-comments/rules",
|
|
74
74
|
plugins: {
|
|
75
75
|
"eslint-comments": import_eslint_plugin_eslint_comments.default
|
|
76
76
|
},
|
|
@@ -158,7 +158,7 @@ async function ignores() {
|
|
|
158
158
|
async function imports() {
|
|
159
159
|
return [
|
|
160
160
|
{
|
|
161
|
-
name: "coderwyd
|
|
161
|
+
name: "coderwyd/imports/rules",
|
|
162
162
|
plugins: {
|
|
163
163
|
antfu: import_eslint_plugin_antfu.default,
|
|
164
164
|
import: pluginImport
|
|
@@ -198,7 +198,7 @@ async function imports() {
|
|
|
198
198
|
},
|
|
199
199
|
{
|
|
200
200
|
files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
|
|
201
|
-
name: "coderwyd
|
|
201
|
+
name: "coderwyd/imports/disables/bin",
|
|
202
202
|
rules: {
|
|
203
203
|
"antfu/no-import-dist": "off",
|
|
204
204
|
"antfu/no-import-node-modules-by-path": "off"
|
|
@@ -235,7 +235,7 @@ async function javascript(options = {}) {
|
|
|
235
235
|
linterOptions: {
|
|
236
236
|
reportUnusedDisableDirectives: true
|
|
237
237
|
},
|
|
238
|
-
name: "coderwyd
|
|
238
|
+
name: "coderwyd/javascript/rules",
|
|
239
239
|
plugins: {
|
|
240
240
|
"unused-imports": import_eslint_plugin_unused_imports.default
|
|
241
241
|
},
|
|
@@ -298,8 +298,8 @@ async function javascript(options = {}) {
|
|
|
298
298
|
"no-multi-str": "error",
|
|
299
299
|
"no-new": "error",
|
|
300
300
|
"no-new-func": "error",
|
|
301
|
+
"no-new-native-nonconstructor": "error",
|
|
301
302
|
"no-new-object": "error",
|
|
302
|
-
"no-new-symbol": "error",
|
|
303
303
|
"no-new-wrappers": "error",
|
|
304
304
|
"no-obj-calls": "error",
|
|
305
305
|
"no-octal": "error",
|
|
@@ -454,13 +454,14 @@ async function javascript(options = {}) {
|
|
|
454
454
|
},
|
|
455
455
|
{
|
|
456
456
|
files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
|
|
457
|
-
name: "coderwyd
|
|
457
|
+
name: "coderwyd/javascript/disables/cli",
|
|
458
458
|
rules: {
|
|
459
459
|
"no-console": "off"
|
|
460
460
|
}
|
|
461
461
|
},
|
|
462
462
|
{
|
|
463
463
|
files: ["**/*.{test,spec}.js?(x)"],
|
|
464
|
+
name: "coderwyd/javascript/disables/test",
|
|
464
465
|
rules: {
|
|
465
466
|
"no-unused-expressions": "off"
|
|
466
467
|
}
|
|
@@ -580,7 +581,7 @@ function getOverrides(options, key) {
|
|
|
580
581
|
async function jsdoc() {
|
|
581
582
|
return [
|
|
582
583
|
{
|
|
583
|
-
name: "coderwyd
|
|
584
|
+
name: "coderwyd/jsdoc/rules",
|
|
584
585
|
plugins: {
|
|
585
586
|
jsdoc: await interopDefault(import("eslint-plugin-jsdoc"))
|
|
586
587
|
},
|
|
@@ -619,7 +620,7 @@ async function jsonc(options = {}) {
|
|
|
619
620
|
]);
|
|
620
621
|
return [
|
|
621
622
|
{
|
|
622
|
-
name: "coderwyd
|
|
623
|
+
name: "coderwyd/jsonc/setup",
|
|
623
624
|
plugins: {
|
|
624
625
|
jsonc: pluginJsonc
|
|
625
626
|
}
|
|
@@ -629,7 +630,7 @@ async function jsonc(options = {}) {
|
|
|
629
630
|
languageOptions: {
|
|
630
631
|
parser: parserJsonc
|
|
631
632
|
},
|
|
632
|
-
name: "coderwyd
|
|
633
|
+
name: "coderwyd/jsonc/rules",
|
|
633
634
|
rules: {
|
|
634
635
|
"jsonc/no-bigint-literals": "error",
|
|
635
636
|
"jsonc/no-binary-expression": "error",
|
|
@@ -689,7 +690,7 @@ async function jsonc(options = {}) {
|
|
|
689
690
|
async function node() {
|
|
690
691
|
return [
|
|
691
692
|
{
|
|
692
|
-
name: "coderwyd
|
|
693
|
+
name: "coderwyd/node/rules",
|
|
693
694
|
plugins: {
|
|
694
695
|
node: import_eslint_plugin_n.default
|
|
695
696
|
},
|
|
@@ -712,7 +713,7 @@ async function sortPackageJson() {
|
|
|
712
713
|
return [
|
|
713
714
|
{
|
|
714
715
|
files: ["**/package.json"],
|
|
715
|
-
name: "coderwyd
|
|
716
|
+
name: "coderwyd/sort/package-json",
|
|
716
717
|
rules: {
|
|
717
718
|
"jsonc/sort-array-values": [
|
|
718
719
|
"error",
|
|
@@ -808,7 +809,7 @@ function sortTsconfig() {
|
|
|
808
809
|
return [
|
|
809
810
|
{
|
|
810
811
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
811
|
-
name: "coderwyd
|
|
812
|
+
name: "coderwyd/sort/tsconfig-json",
|
|
812
813
|
rules: {
|
|
813
814
|
"jsonc/sort-keys": [
|
|
814
815
|
"error",
|
|
@@ -940,14 +941,14 @@ async function prettier(rules = {}) {
|
|
|
940
941
|
};
|
|
941
942
|
const configs = [
|
|
942
943
|
{
|
|
943
|
-
name: "coderwyd
|
|
944
|
+
name: "coderwyd/prettier/setup",
|
|
944
945
|
plugins: {
|
|
945
946
|
prettier: pluginPrettier
|
|
946
947
|
}
|
|
947
948
|
},
|
|
948
949
|
{
|
|
949
950
|
files: GLOB_PRETTIER_LINT,
|
|
950
|
-
name: "coderwyd
|
|
951
|
+
name: "coderwyd/prettier/rules",
|
|
951
952
|
rules: {
|
|
952
953
|
...eslintRules,
|
|
953
954
|
"prettier/prettier": ["warn", pRules],
|
|
@@ -1012,13 +1013,13 @@ async function typescript(options = {}) {
|
|
|
1012
1013
|
...parserOptions
|
|
1013
1014
|
}
|
|
1014
1015
|
},
|
|
1015
|
-
name: `coderwyd
|
|
1016
|
+
name: `coderwyd/typescript/${typeAware ? "type-aware-parser" : "parser"}`
|
|
1016
1017
|
};
|
|
1017
1018
|
}
|
|
1018
1019
|
return [
|
|
1019
1020
|
{
|
|
1020
1021
|
// Install the plugins without globs, so they can be configured separately.
|
|
1021
|
-
name: "coderwyd
|
|
1022
|
+
name: "coderwyd/typescript/setup",
|
|
1022
1023
|
plugins: {
|
|
1023
1024
|
antfu: import_eslint_plugin_antfu.default,
|
|
1024
1025
|
ts: pluginTs
|
|
@@ -1031,7 +1032,7 @@ async function typescript(options = {}) {
|
|
|
1031
1032
|
] : [makeParser(false, files)],
|
|
1032
1033
|
{
|
|
1033
1034
|
files,
|
|
1034
|
-
name: "coderwyd
|
|
1035
|
+
name: "coderwyd/typescript/rules",
|
|
1035
1036
|
rules: {
|
|
1036
1037
|
...renameRules(
|
|
1037
1038
|
pluginTs.configs["eslint-recommended"].overrides[0].rules,
|
|
@@ -1079,17 +1080,19 @@ async function typescript(options = {}) {
|
|
|
1079
1080
|
...overrides
|
|
1080
1081
|
}
|
|
1081
1082
|
},
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1083
|
+
...isTypeAware ? [
|
|
1084
|
+
{
|
|
1085
|
+
files: filesTypeAware,
|
|
1086
|
+
name: "coderwyd/typescript/rules-type-aware",
|
|
1087
|
+
rules: {
|
|
1088
|
+
...tsconfigPath ? typeAwareRules : {},
|
|
1089
|
+
...overrides
|
|
1090
|
+
}
|
|
1088
1091
|
}
|
|
1089
|
-
|
|
1092
|
+
] : [],
|
|
1090
1093
|
{
|
|
1091
1094
|
files: ["**/*.d.ts"],
|
|
1092
|
-
name: "coderwyd
|
|
1095
|
+
name: "coderwyd/typescript/disables/dts",
|
|
1093
1096
|
rules: {
|
|
1094
1097
|
"eslint-comments/no-unlimited-disable": "off",
|
|
1095
1098
|
"import/no-duplicates": "off",
|
|
@@ -1099,14 +1102,14 @@ async function typescript(options = {}) {
|
|
|
1099
1102
|
},
|
|
1100
1103
|
{
|
|
1101
1104
|
files: ["**/*.{test,spec}.ts?(x)"],
|
|
1102
|
-
name: "coderwyd
|
|
1105
|
+
name: "coderwyd/typescript/disables/test",
|
|
1103
1106
|
rules: {
|
|
1104
1107
|
"no-unused-expressions": "off"
|
|
1105
1108
|
}
|
|
1106
1109
|
},
|
|
1107
1110
|
{
|
|
1108
1111
|
files: ["**/*.js", "**/*.cjs"],
|
|
1109
|
-
name: "coderwyd
|
|
1112
|
+
name: "coderwyd/typescript/disables/cjs",
|
|
1110
1113
|
rules: {
|
|
1111
1114
|
"ts/no-require-imports": "off",
|
|
1112
1115
|
"ts/no-var-requires": "off"
|
|
@@ -1119,7 +1122,7 @@ async function typescript(options = {}) {
|
|
|
1119
1122
|
async function unicorn() {
|
|
1120
1123
|
return [
|
|
1121
1124
|
{
|
|
1122
|
-
name: "coderwyd
|
|
1125
|
+
name: "coderwyd/unicorn/rules",
|
|
1123
1126
|
plugins: {
|
|
1124
1127
|
unicorn: import_eslint_plugin_unicorn.default
|
|
1125
1128
|
},
|
|
@@ -1227,7 +1230,7 @@ async function vue(options = {}) {
|
|
|
1227
1230
|
watchEffect: "readonly"
|
|
1228
1231
|
}
|
|
1229
1232
|
},
|
|
1230
|
-
name: "coderwyd
|
|
1233
|
+
name: "coderwyd/vue/setup",
|
|
1231
1234
|
plugins: {
|
|
1232
1235
|
vue: pluginVue
|
|
1233
1236
|
}
|
|
@@ -1247,7 +1250,7 @@ async function vue(options = {}) {
|
|
|
1247
1250
|
sourceType: "module"
|
|
1248
1251
|
}
|
|
1249
1252
|
},
|
|
1250
|
-
name: "coderwyd
|
|
1253
|
+
name: "coderwyd/vue/rules",
|
|
1251
1254
|
processor: pluginVue.processors[".vue"],
|
|
1252
1255
|
rules: {
|
|
1253
1256
|
...pluginVue.configs.base.rules,
|
|
@@ -1382,7 +1385,7 @@ async function test(options = {}) {
|
|
|
1382
1385
|
]);
|
|
1383
1386
|
return [
|
|
1384
1387
|
{
|
|
1385
|
-
name: "coderwyd
|
|
1388
|
+
name: "coderwyd/test/setup",
|
|
1386
1389
|
plugins: {
|
|
1387
1390
|
test: {
|
|
1388
1391
|
...pluginVitest,
|
|
@@ -1396,7 +1399,7 @@ async function test(options = {}) {
|
|
|
1396
1399
|
},
|
|
1397
1400
|
{
|
|
1398
1401
|
files,
|
|
1399
|
-
name: "coderwyd
|
|
1402
|
+
name: "coderwyd/test/rules",
|
|
1400
1403
|
rules: {
|
|
1401
1404
|
"node/prefer-global/process": "off",
|
|
1402
1405
|
"test/consistent-test-it": [
|
|
@@ -1418,7 +1421,7 @@ async function test(options = {}) {
|
|
|
1418
1421
|
async function perfectionist() {
|
|
1419
1422
|
return [
|
|
1420
1423
|
{
|
|
1421
|
-
name: "coderwyd
|
|
1424
|
+
name: "coderwyd/perfectionist/setup",
|
|
1422
1425
|
plugins: {
|
|
1423
1426
|
perfectionist: import_eslint_plugin_perfectionist.default
|
|
1424
1427
|
}
|
|
@@ -1452,7 +1455,7 @@ async function react(options = {}) {
|
|
|
1452
1455
|
);
|
|
1453
1456
|
return [
|
|
1454
1457
|
{
|
|
1455
|
-
name: "coderwyd
|
|
1458
|
+
name: "coderwyd/react/setup",
|
|
1456
1459
|
plugins: {
|
|
1457
1460
|
react: pluginReact,
|
|
1458
1461
|
"react-hooks": pluginReactHooks,
|
|
@@ -1473,7 +1476,7 @@ async function react(options = {}) {
|
|
|
1473
1476
|
}
|
|
1474
1477
|
}
|
|
1475
1478
|
},
|
|
1476
|
-
name: "coderwyd
|
|
1479
|
+
name: "coderwyd/react/rules",
|
|
1477
1480
|
rules: {
|
|
1478
1481
|
// recommended rules react-hooks
|
|
1479
1482
|
"react-hooks/exhaustive-deps": "warn",
|
|
@@ -1526,7 +1529,7 @@ async function unocss(options = {}) {
|
|
|
1526
1529
|
]);
|
|
1527
1530
|
return [
|
|
1528
1531
|
{
|
|
1529
|
-
name: "coderwyd
|
|
1532
|
+
name: "coderwyd/unocss/rules",
|
|
1530
1533
|
plugins: {
|
|
1531
1534
|
unocss: pluginUnoCSS
|
|
1532
1535
|
},
|
|
@@ -1572,7 +1575,7 @@ async function formatter(options = {}, prettierRules2 = {}) {
|
|
|
1572
1575
|
languageOptions: {
|
|
1573
1576
|
parser: parserPlain
|
|
1574
1577
|
},
|
|
1575
|
-
name: `coderwyd
|
|
1578
|
+
name: `coderwyd/formatter/${parser}`,
|
|
1576
1579
|
plugins: {
|
|
1577
1580
|
prettier: pluginPrettier
|
|
1578
1581
|
},
|
|
@@ -1587,7 +1590,7 @@ async function formatter(options = {}, prettierRules2 = {}) {
|
|
|
1587
1590
|
}
|
|
1588
1591
|
const configs = [
|
|
1589
1592
|
{
|
|
1590
|
-
name: "coderwyd
|
|
1593
|
+
name: "coderwyd/formatter/setup",
|
|
1591
1594
|
plugins: {
|
|
1592
1595
|
prettier: pluginPrettier
|
|
1593
1596
|
}
|
|
@@ -1635,7 +1638,7 @@ async function svelte(options = {}) {
|
|
|
1635
1638
|
]);
|
|
1636
1639
|
return [
|
|
1637
1640
|
{
|
|
1638
|
-
name: "coderwyd
|
|
1641
|
+
name: "coderwyd/svelte/setup",
|
|
1639
1642
|
plugins: {
|
|
1640
1643
|
svelte: pluginSvelte
|
|
1641
1644
|
}
|
|
@@ -1651,7 +1654,7 @@ async function svelte(options = {}) {
|
|
|
1651
1654
|
) : null
|
|
1652
1655
|
}
|
|
1653
1656
|
},
|
|
1654
|
-
name: "coderwyd
|
|
1657
|
+
name: "coderwyd/svelte/rules",
|
|
1655
1658
|
processor: pluginSvelte.processors[".svelte"],
|
|
1656
1659
|
rules: {
|
|
1657
1660
|
"import/no-mutable-exports": "off",
|
|
@@ -1727,7 +1730,7 @@ async function tailwindcss(options = {}) {
|
|
|
1727
1730
|
);
|
|
1728
1731
|
return [
|
|
1729
1732
|
{
|
|
1730
|
-
name: "coderwyd
|
|
1733
|
+
name: "coderwyd/tailwindcss/rules",
|
|
1731
1734
|
plugins: {
|
|
1732
1735
|
tailwindcss: pluginTailwindcss
|
|
1733
1736
|
},
|