@coderwyd/eslint-config 2.3.3 → 2.4.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 +0 -2
- package/dist/cli.cjs +15 -15
- package/dist/cli.js +15 -15
- package/dist/index.cjs +31 -13
- package/dist/index.d.cts +138 -84
- package/dist/index.d.ts +138 -84
- package/dist/index.js +31 -13
- package/package.json +29 -29
package/dist/index.js
CHANGED
|
@@ -392,6 +392,7 @@ async function javascript(options = {}) {
|
|
|
392
392
|
{
|
|
393
393
|
args: "after-used",
|
|
394
394
|
argsIgnorePattern: "^_",
|
|
395
|
+
ignoreRestSiblings: true,
|
|
395
396
|
vars: "all",
|
|
396
397
|
varsIgnorePattern: "^_"
|
|
397
398
|
}
|
|
@@ -1086,7 +1087,7 @@ async function unicorn() {
|
|
|
1086
1087
|
"unicorn/custom-error-definition": "error",
|
|
1087
1088
|
"unicorn/error-message": "error",
|
|
1088
1089
|
"unicorn/escape-case": "error",
|
|
1089
|
-
|
|
1090
|
+
// 'unicorn/explicit-length-check': 'error',
|
|
1090
1091
|
// 'unicorn/filename-case': [
|
|
1091
1092
|
// 'error',
|
|
1092
1093
|
// {
|
|
@@ -1095,9 +1096,10 @@ async function unicorn() {
|
|
|
1095
1096
|
// },
|
|
1096
1097
|
// ],
|
|
1097
1098
|
"unicorn/new-for-builtins": "error",
|
|
1098
|
-
|
|
1099
|
+
// 'unicorn/no-array-callback-reference': 'error',
|
|
1099
1100
|
"unicorn/no-array-method-this-argument": "error",
|
|
1100
1101
|
"unicorn/no-array-push-push": "error",
|
|
1102
|
+
"unicorn/no-await-in-promise-methods": "error",
|
|
1101
1103
|
"unicorn/no-console-spaces": "error",
|
|
1102
1104
|
"unicorn/no-for-loop": "error",
|
|
1103
1105
|
"unicorn/no-hex-escape": "error",
|
|
@@ -1106,6 +1108,7 @@ async function unicorn() {
|
|
|
1106
1108
|
"unicorn/no-lonely-if": "error",
|
|
1107
1109
|
"unicorn/no-new-array": "error",
|
|
1108
1110
|
"unicorn/no-new-buffer": "error",
|
|
1111
|
+
"unicorn/no-single-promise-in-promise-methods": "error",
|
|
1109
1112
|
"unicorn/no-static-only-class": "error",
|
|
1110
1113
|
"unicorn/no-unnecessary-await": "error",
|
|
1111
1114
|
"unicorn/no-zero-fractions": `error`,
|
|
@@ -1138,7 +1141,8 @@ async function unicorn() {
|
|
|
1138
1141
|
"unicorn/prefer-string-slice": "error",
|
|
1139
1142
|
"unicorn/prefer-string-starts-ends-with": "error",
|
|
1140
1143
|
"unicorn/prefer-string-trim-start-end": "error",
|
|
1141
|
-
|
|
1144
|
+
// top level await is not supported in all environments
|
|
1145
|
+
// 'unicorn/prefer-top-level-await': 'error',
|
|
1142
1146
|
"unicorn/prefer-type-error": "error",
|
|
1143
1147
|
"unicorn/throw-new-error": "error"
|
|
1144
1148
|
}
|
|
@@ -1330,6 +1334,7 @@ async function vue(options = {}) {
|
|
|
1330
1334
|
}
|
|
1331
1335
|
|
|
1332
1336
|
// src/configs/test.ts
|
|
1337
|
+
var _pluginTest;
|
|
1333
1338
|
async function test(options = {}) {
|
|
1334
1339
|
const { files = GLOB_TESTS, isInEditor: isInEditor2 = false, overrides = {} } = options;
|
|
1335
1340
|
const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
|
|
@@ -1337,18 +1342,19 @@ async function test(options = {}) {
|
|
|
1337
1342
|
// @ts-expect-error missing types
|
|
1338
1343
|
interopDefault(import("eslint-plugin-no-only-tests"))
|
|
1339
1344
|
]);
|
|
1345
|
+
_pluginTest = _pluginTest || {
|
|
1346
|
+
...pluginVitest,
|
|
1347
|
+
rules: {
|
|
1348
|
+
...pluginVitest.rules,
|
|
1349
|
+
// extend `test/no-only-tests` rule
|
|
1350
|
+
...pluginNoOnlyTests.rules
|
|
1351
|
+
}
|
|
1352
|
+
};
|
|
1340
1353
|
return [
|
|
1341
1354
|
{
|
|
1342
1355
|
name: "coderwyd/test/setup",
|
|
1343
1356
|
plugins: {
|
|
1344
|
-
test:
|
|
1345
|
-
...pluginVitest,
|
|
1346
|
-
rules: {
|
|
1347
|
-
...pluginVitest.rules,
|
|
1348
|
-
// extend `test/no-only-tests` rule
|
|
1349
|
-
...pluginNoOnlyTests.rules
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1357
|
+
test: _pluginTest
|
|
1352
1358
|
}
|
|
1353
1359
|
},
|
|
1354
1360
|
{
|
|
@@ -1621,7 +1627,7 @@ async function svelte(options = {}) {
|
|
|
1621
1627
|
caughtErrors: "none",
|
|
1622
1628
|
ignoreRestSiblings: true,
|
|
1623
1629
|
vars: "all",
|
|
1624
|
-
varsIgnorePattern: "
|
|
1630
|
+
varsIgnorePattern: "^(\\$\\$Props$|\\$\\$Events$|\\$\\$Slots$)"
|
|
1625
1631
|
}
|
|
1626
1632
|
],
|
|
1627
1633
|
"svelte/comment-directive": "error",
|
|
@@ -1651,7 +1657,7 @@ async function svelte(options = {}) {
|
|
|
1651
1657
|
args: "after-used",
|
|
1652
1658
|
argsIgnorePattern: "^_",
|
|
1653
1659
|
vars: "all",
|
|
1654
|
-
varsIgnorePattern: "^(_|\\$\\$Props$)"
|
|
1660
|
+
varsIgnorePattern: "^(_|\\$\\$Props$|\\$\\$Events$|\\$\\$Slots$)"
|
|
1655
1661
|
}
|
|
1656
1662
|
],
|
|
1657
1663
|
...{
|
|
@@ -1703,6 +1709,17 @@ async function tailwindcss(options = {}) {
|
|
|
1703
1709
|
];
|
|
1704
1710
|
}
|
|
1705
1711
|
|
|
1712
|
+
// src/configs/command.ts
|
|
1713
|
+
import createCommand from "eslint-plugin-command/config";
|
|
1714
|
+
async function command() {
|
|
1715
|
+
return [
|
|
1716
|
+
{
|
|
1717
|
+
...createCommand(),
|
|
1718
|
+
name: "coderwyd/command/rules"
|
|
1719
|
+
}
|
|
1720
|
+
];
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1706
1723
|
// src/env.ts
|
|
1707
1724
|
import process3 from "node:process";
|
|
1708
1725
|
import { isPackageExists as isPackageExists3 } from "local-pkg";
|
|
@@ -1777,6 +1794,7 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1777
1794
|
jsdoc(),
|
|
1778
1795
|
imports(),
|
|
1779
1796
|
unicorn(),
|
|
1797
|
+
command(),
|
|
1780
1798
|
// Optional plugins (installed but not enabled by default)
|
|
1781
1799
|
perfectionist()
|
|
1782
1800
|
);
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coderwyd/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
5
|
-
"packageManager": "pnpm@8.15.6",
|
|
4
|
+
"version": "2.4.0",
|
|
6
5
|
"description": "Donny's ESLint config",
|
|
7
6
|
"author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
|
|
8
7
|
"license": "MIT",
|
|
@@ -66,28 +65,29 @@
|
|
|
66
65
|
}
|
|
67
66
|
},
|
|
68
67
|
"dependencies": {
|
|
69
|
-
"@antfu/install-pkg": "^0.3.
|
|
68
|
+
"@antfu/install-pkg": "^0.3.3",
|
|
70
69
|
"@toml-tools/parser": "^1.0.0",
|
|
71
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
72
|
-
"@typescript-eslint/parser": "^7.
|
|
70
|
+
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
|
71
|
+
"@typescript-eslint/parser": "^7.8.0",
|
|
73
72
|
"eslint-config-flat-gitignore": "^0.1.5",
|
|
74
73
|
"eslint-config-prettier": "^9.1.0",
|
|
75
|
-
"eslint-plugin-antfu": "^2.
|
|
74
|
+
"eslint-plugin-antfu": "^2.2.0",
|
|
75
|
+
"eslint-plugin-command": "^0.2.0",
|
|
76
76
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
77
77
|
"eslint-plugin-import-x": "^0.5.0",
|
|
78
|
-
"eslint-plugin-jsdoc": "^48.2.
|
|
79
|
-
"eslint-plugin-jsonc": "^2.15.
|
|
80
|
-
"eslint-plugin-n": "^
|
|
78
|
+
"eslint-plugin-jsdoc": "^48.2.4",
|
|
79
|
+
"eslint-plugin-jsonc": "^2.15.1",
|
|
80
|
+
"eslint-plugin-n": "^17.5.1",
|
|
81
81
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
82
|
-
"eslint-plugin-perfectionist": "^2.
|
|
82
|
+
"eslint-plugin-perfectionist": "^2.10.0",
|
|
83
83
|
"eslint-plugin-prettier": "^5.1.3",
|
|
84
84
|
"eslint-plugin-tailwindcss": "^3.15.1",
|
|
85
85
|
"eslint-plugin-unicorn": "^52.0.0",
|
|
86
|
-
"eslint-plugin-unused-imports": "^3.
|
|
87
|
-
"eslint-plugin-vitest": "^0.4
|
|
88
|
-
"eslint-plugin-vue": "^9.
|
|
89
|
-
"eslint-typegen": "^0.2.
|
|
90
|
-
"globals": "^15.
|
|
86
|
+
"eslint-plugin-unused-imports": "^3.2.0",
|
|
87
|
+
"eslint-plugin-vitest": "^0.5.4",
|
|
88
|
+
"eslint-plugin-vue": "^9.26.0",
|
|
89
|
+
"eslint-typegen": "^0.2.4",
|
|
90
|
+
"globals": "^15.2.0",
|
|
91
91
|
"jsonc-eslint-parser": "^2.4.0",
|
|
92
92
|
"local-pkg": "^0.5.0",
|
|
93
93
|
"parse-gitignore": "^2.0.0",
|
|
@@ -100,30 +100,30 @@
|
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@antfu/ni": "^0.21.12",
|
|
103
|
-
"@eslint/config-inspector": "^0.4.
|
|
104
|
-
"@types/eslint": "^8.56.
|
|
103
|
+
"@eslint/config-inspector": "^0.4.8",
|
|
104
|
+
"@types/eslint": "^8.56.10",
|
|
105
105
|
"@types/fs-extra": "^11.0.4",
|
|
106
|
-
"@types/node": "^20.12.
|
|
106
|
+
"@types/node": "^20.12.11",
|
|
107
107
|
"@types/prompts": "^2.4.9",
|
|
108
108
|
"@types/yargs": "^17.0.32",
|
|
109
|
-
"@unocss/eslint-plugin": "^0.
|
|
110
|
-
"bumpp": "^9.4.
|
|
111
|
-
"eslint": "9.
|
|
109
|
+
"@unocss/eslint-plugin": "^0.60.0",
|
|
110
|
+
"bumpp": "^9.4.1",
|
|
111
|
+
"eslint": "9.2.0",
|
|
112
112
|
"eslint-plugin-react": "^7.34.1",
|
|
113
|
-
"eslint-plugin-react-hooks": "^4.6.
|
|
114
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
115
|
-
"eslint-plugin-svelte": "2.
|
|
116
|
-
"execa": "^
|
|
113
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
114
|
+
"eslint-plugin-react-refresh": "^0.4.7",
|
|
115
|
+
"eslint-plugin-svelte": "2.38.0",
|
|
116
|
+
"execa": "^9.0.1",
|
|
117
117
|
"fast-glob": "^3.3.2",
|
|
118
118
|
"fs-extra": "^11.2.0",
|
|
119
119
|
"lint-staged": "^15.2.2",
|
|
120
120
|
"rimraf": "^5.0.5",
|
|
121
121
|
"simple-git-hooks": "^2.11.1",
|
|
122
|
-
"svelte": "^4.2.
|
|
123
|
-
"svelte-eslint-parser": "^0.
|
|
122
|
+
"svelte": "^4.2.16",
|
|
123
|
+
"svelte-eslint-parser": "^0.36.0",
|
|
124
124
|
"tsup": "^8.0.2",
|
|
125
|
-
"tsx": "^4.
|
|
126
|
-
"typescript": "^5.4.
|
|
125
|
+
"tsx": "^4.9.3",
|
|
126
|
+
"typescript": "^5.4.5"
|
|
127
127
|
},
|
|
128
128
|
"simple-git-hooks": {
|
|
129
129
|
"pre-commit": "pnpx nano-staged"
|