@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/README.md
CHANGED
|
@@ -40,8 +40,6 @@ const { defineConfig } = require('@coderwyd/eslint-config')
|
|
|
40
40
|
module.exports = defineConfig()
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
> Note that `.eslintignore` no longer works in Flat config, see [customization](#customization) for more details.
|
|
44
|
-
|
|
45
43
|
### Add script for package.json
|
|
46
44
|
|
|
47
45
|
For example:
|
package/dist/cli.cjs
CHANGED
|
@@ -46,33 +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.
|
|
49
|
+
var version = "2.4.0";
|
|
50
50
|
var devDependencies = {
|
|
51
51
|
"@antfu/ni": "^0.21.12",
|
|
52
|
-
"@eslint/config-inspector": "^0.4.
|
|
53
|
-
"@types/eslint": "^8.56.
|
|
52
|
+
"@eslint/config-inspector": "^0.4.8",
|
|
53
|
+
"@types/eslint": "^8.56.10",
|
|
54
54
|
"@types/fs-extra": "^11.0.4",
|
|
55
|
-
"@types/node": "^20.12.
|
|
55
|
+
"@types/node": "^20.12.11",
|
|
56
56
|
"@types/prompts": "^2.4.9",
|
|
57
57
|
"@types/yargs": "^17.0.32",
|
|
58
|
-
"@unocss/eslint-plugin": "^0.
|
|
59
|
-
bumpp: "^9.4.
|
|
60
|
-
eslint: "9.
|
|
58
|
+
"@unocss/eslint-plugin": "^0.60.0",
|
|
59
|
+
bumpp: "^9.4.1",
|
|
60
|
+
eslint: "9.2.0",
|
|
61
61
|
"eslint-plugin-react": "^7.34.1",
|
|
62
|
-
"eslint-plugin-react-hooks": "^4.6.
|
|
63
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
64
|
-
"eslint-plugin-svelte": "2.
|
|
65
|
-
execa: "^
|
|
62
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
63
|
+
"eslint-plugin-react-refresh": "^0.4.7",
|
|
64
|
+
"eslint-plugin-svelte": "2.38.0",
|
|
65
|
+
execa: "^9.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.
|
|
72
|
-
"svelte-eslint-parser": "^0.
|
|
71
|
+
svelte: "^4.2.16",
|
|
72
|
+
"svelte-eslint-parser": "^0.36.0",
|
|
73
73
|
tsup: "^8.0.2",
|
|
74
|
-
tsx: "^4.
|
|
75
|
-
typescript: "^5.4.
|
|
74
|
+
tsx: "^4.9.3",
|
|
75
|
+
typescript: "^5.4.5"
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
// src/cli/constants.ts
|
package/dist/cli.js
CHANGED
|
@@ -17,33 +17,33 @@ import parse from "parse-gitignore";
|
|
|
17
17
|
import c from "picocolors";
|
|
18
18
|
|
|
19
19
|
// package.json
|
|
20
|
-
var version = "2.
|
|
20
|
+
var version = "2.4.0";
|
|
21
21
|
var devDependencies = {
|
|
22
22
|
"@antfu/ni": "^0.21.12",
|
|
23
|
-
"@eslint/config-inspector": "^0.4.
|
|
24
|
-
"@types/eslint": "^8.56.
|
|
23
|
+
"@eslint/config-inspector": "^0.4.8",
|
|
24
|
+
"@types/eslint": "^8.56.10",
|
|
25
25
|
"@types/fs-extra": "^11.0.4",
|
|
26
|
-
"@types/node": "^20.12.
|
|
26
|
+
"@types/node": "^20.12.11",
|
|
27
27
|
"@types/prompts": "^2.4.9",
|
|
28
28
|
"@types/yargs": "^17.0.32",
|
|
29
|
-
"@unocss/eslint-plugin": "^0.
|
|
30
|
-
bumpp: "^9.4.
|
|
31
|
-
eslint: "9.
|
|
29
|
+
"@unocss/eslint-plugin": "^0.60.0",
|
|
30
|
+
bumpp: "^9.4.1",
|
|
31
|
+
eslint: "9.2.0",
|
|
32
32
|
"eslint-plugin-react": "^7.34.1",
|
|
33
|
-
"eslint-plugin-react-hooks": "^4.6.
|
|
34
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
35
|
-
"eslint-plugin-svelte": "2.
|
|
36
|
-
execa: "^
|
|
33
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
34
|
+
"eslint-plugin-react-refresh": "^0.4.7",
|
|
35
|
+
"eslint-plugin-svelte": "2.38.0",
|
|
36
|
+
execa: "^9.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.
|
|
43
|
-
"svelte-eslint-parser": "^0.
|
|
42
|
+
svelte: "^4.2.16",
|
|
43
|
+
"svelte-eslint-parser": "^0.36.0",
|
|
44
44
|
tsup: "^8.0.2",
|
|
45
|
-
tsx: "^4.
|
|
46
|
-
typescript: "^5.4.
|
|
45
|
+
tsx: "^4.9.3",
|
|
46
|
+
typescript: "^5.4.5"
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
// src/cli/constants.ts
|
package/dist/index.cjs
CHANGED
|
@@ -438,6 +438,7 @@ async function javascript(options = {}) {
|
|
|
438
438
|
{
|
|
439
439
|
args: "after-used",
|
|
440
440
|
argsIgnorePattern: "^_",
|
|
441
|
+
ignoreRestSiblings: true,
|
|
441
442
|
vars: "all",
|
|
442
443
|
varsIgnorePattern: "^_"
|
|
443
444
|
}
|
|
@@ -1132,7 +1133,7 @@ async function unicorn() {
|
|
|
1132
1133
|
"unicorn/custom-error-definition": "error",
|
|
1133
1134
|
"unicorn/error-message": "error",
|
|
1134
1135
|
"unicorn/escape-case": "error",
|
|
1135
|
-
|
|
1136
|
+
// 'unicorn/explicit-length-check': 'error',
|
|
1136
1137
|
// 'unicorn/filename-case': [
|
|
1137
1138
|
// 'error',
|
|
1138
1139
|
// {
|
|
@@ -1141,9 +1142,10 @@ async function unicorn() {
|
|
|
1141
1142
|
// },
|
|
1142
1143
|
// ],
|
|
1143
1144
|
"unicorn/new-for-builtins": "error",
|
|
1144
|
-
|
|
1145
|
+
// 'unicorn/no-array-callback-reference': 'error',
|
|
1145
1146
|
"unicorn/no-array-method-this-argument": "error",
|
|
1146
1147
|
"unicorn/no-array-push-push": "error",
|
|
1148
|
+
"unicorn/no-await-in-promise-methods": "error",
|
|
1147
1149
|
"unicorn/no-console-spaces": "error",
|
|
1148
1150
|
"unicorn/no-for-loop": "error",
|
|
1149
1151
|
"unicorn/no-hex-escape": "error",
|
|
@@ -1152,6 +1154,7 @@ async function unicorn() {
|
|
|
1152
1154
|
"unicorn/no-lonely-if": "error",
|
|
1153
1155
|
"unicorn/no-new-array": "error",
|
|
1154
1156
|
"unicorn/no-new-buffer": "error",
|
|
1157
|
+
"unicorn/no-single-promise-in-promise-methods": "error",
|
|
1155
1158
|
"unicorn/no-static-only-class": "error",
|
|
1156
1159
|
"unicorn/no-unnecessary-await": "error",
|
|
1157
1160
|
"unicorn/no-zero-fractions": `error`,
|
|
@@ -1184,7 +1187,8 @@ async function unicorn() {
|
|
|
1184
1187
|
"unicorn/prefer-string-slice": "error",
|
|
1185
1188
|
"unicorn/prefer-string-starts-ends-with": "error",
|
|
1186
1189
|
"unicorn/prefer-string-trim-start-end": "error",
|
|
1187
|
-
|
|
1190
|
+
// top level await is not supported in all environments
|
|
1191
|
+
// 'unicorn/prefer-top-level-await': 'error',
|
|
1188
1192
|
"unicorn/prefer-type-error": "error",
|
|
1189
1193
|
"unicorn/throw-new-error": "error"
|
|
1190
1194
|
}
|
|
@@ -1376,6 +1380,7 @@ async function vue(options = {}) {
|
|
|
1376
1380
|
}
|
|
1377
1381
|
|
|
1378
1382
|
// src/configs/test.ts
|
|
1383
|
+
var _pluginTest;
|
|
1379
1384
|
async function test(options = {}) {
|
|
1380
1385
|
const { files = GLOB_TESTS, isInEditor: isInEditor2 = false, overrides = {} } = options;
|
|
1381
1386
|
const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
|
|
@@ -1383,18 +1388,19 @@ async function test(options = {}) {
|
|
|
1383
1388
|
// @ts-expect-error missing types
|
|
1384
1389
|
interopDefault(import("eslint-plugin-no-only-tests"))
|
|
1385
1390
|
]);
|
|
1391
|
+
_pluginTest = _pluginTest || {
|
|
1392
|
+
...pluginVitest,
|
|
1393
|
+
rules: {
|
|
1394
|
+
...pluginVitest.rules,
|
|
1395
|
+
// extend `test/no-only-tests` rule
|
|
1396
|
+
...pluginNoOnlyTests.rules
|
|
1397
|
+
}
|
|
1398
|
+
};
|
|
1386
1399
|
return [
|
|
1387
1400
|
{
|
|
1388
1401
|
name: "coderwyd/test/setup",
|
|
1389
1402
|
plugins: {
|
|
1390
|
-
test:
|
|
1391
|
-
...pluginVitest,
|
|
1392
|
-
rules: {
|
|
1393
|
-
...pluginVitest.rules,
|
|
1394
|
-
// extend `test/no-only-tests` rule
|
|
1395
|
-
...pluginNoOnlyTests.rules
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1403
|
+
test: _pluginTest
|
|
1398
1404
|
}
|
|
1399
1405
|
},
|
|
1400
1406
|
{
|
|
@@ -1667,7 +1673,7 @@ async function svelte(options = {}) {
|
|
|
1667
1673
|
caughtErrors: "none",
|
|
1668
1674
|
ignoreRestSiblings: true,
|
|
1669
1675
|
vars: "all",
|
|
1670
|
-
varsIgnorePattern: "
|
|
1676
|
+
varsIgnorePattern: "^(\\$\\$Props$|\\$\\$Events$|\\$\\$Slots$)"
|
|
1671
1677
|
}
|
|
1672
1678
|
],
|
|
1673
1679
|
"svelte/comment-directive": "error",
|
|
@@ -1697,7 +1703,7 @@ async function svelte(options = {}) {
|
|
|
1697
1703
|
args: "after-used",
|
|
1698
1704
|
argsIgnorePattern: "^_",
|
|
1699
1705
|
vars: "all",
|
|
1700
|
-
varsIgnorePattern: "^(_|\\$\\$Props$)"
|
|
1706
|
+
varsIgnorePattern: "^(_|\\$\\$Props$|\\$\\$Events$|\\$\\$Slots$)"
|
|
1701
1707
|
}
|
|
1702
1708
|
],
|
|
1703
1709
|
...{
|
|
@@ -1749,6 +1755,17 @@ async function tailwindcss(options = {}) {
|
|
|
1749
1755
|
];
|
|
1750
1756
|
}
|
|
1751
1757
|
|
|
1758
|
+
// src/configs/command.ts
|
|
1759
|
+
var import_config = __toESM(require("eslint-plugin-command/config"), 1);
|
|
1760
|
+
async function command() {
|
|
1761
|
+
return [
|
|
1762
|
+
{
|
|
1763
|
+
...(0, import_config.default)(),
|
|
1764
|
+
name: "coderwyd/command/rules"
|
|
1765
|
+
}
|
|
1766
|
+
];
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1752
1769
|
// src/env.ts
|
|
1753
1770
|
var import_node_process3 = __toESM(require("process"), 1);
|
|
1754
1771
|
var import_local_pkg3 = require("local-pkg");
|
|
@@ -1823,6 +1840,7 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1823
1840
|
jsdoc(),
|
|
1824
1841
|
imports(),
|
|
1825
1842
|
unicorn(),
|
|
1843
|
+
command(),
|
|
1826
1844
|
// Optional plugins (installed but not enabled by default)
|
|
1827
1845
|
perfectionist()
|
|
1828
1846
|
);
|