@coderwyd/eslint-config 4.0.0 → 4.1.1
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.js +14 -14
- package/dist/index.d.ts +1166 -399
- package/dist/index.js +30 -12
- package/package.json +29 -28
package/dist/index.js
CHANGED
|
@@ -12,11 +12,12 @@ function command() {
|
|
|
12
12
|
// src/plugins/index.ts
|
|
13
13
|
import { default as default2 } from "@eslint-community/eslint-plugin-eslint-comments";
|
|
14
14
|
import { default as default3 } from "eslint-plugin-antfu";
|
|
15
|
+
import { default as default4 } from "eslint-plugin-de-morgan";
|
|
15
16
|
import * as pluginImport from "eslint-plugin-import-x";
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
17
|
+
import { default as default5 } from "eslint-plugin-n";
|
|
18
|
+
import { default as default6 } from "eslint-plugin-perfectionist";
|
|
19
|
+
import { default as default7 } from "eslint-plugin-unicorn";
|
|
20
|
+
import { default as default8 } from "eslint-plugin-unused-imports";
|
|
20
21
|
|
|
21
22
|
// src/configs/comments.ts
|
|
22
23
|
function comments() {
|
|
@@ -36,6 +37,22 @@ function comments() {
|
|
|
36
37
|
];
|
|
37
38
|
}
|
|
38
39
|
|
|
40
|
+
// src/configs/de-morgan.ts
|
|
41
|
+
function deMorgan() {
|
|
42
|
+
return [
|
|
43
|
+
{
|
|
44
|
+
name: "coderwyd/de-morgan/rules",
|
|
45
|
+
plugins: {
|
|
46
|
+
"de-morgan": default4
|
|
47
|
+
},
|
|
48
|
+
rules: {
|
|
49
|
+
"de-morgan/no-negated-conjunction": "error",
|
|
50
|
+
"de-morgan/no-negated-disjunction": "error"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
|
|
39
56
|
// src/constants/glob.ts
|
|
40
57
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
41
58
|
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
@@ -159,7 +176,7 @@ function javascript(options = {}) {
|
|
|
159
176
|
{
|
|
160
177
|
name: "coderwyd/javascript/rules",
|
|
161
178
|
plugins: {
|
|
162
|
-
"unused-imports":
|
|
179
|
+
"unused-imports": default8
|
|
163
180
|
},
|
|
164
181
|
rules: {
|
|
165
182
|
"accessor-pairs": [
|
|
@@ -436,9 +453,9 @@ function resolveSubOptions(options, key) {
|
|
|
436
453
|
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
437
454
|
}
|
|
438
455
|
function getOverrides(options, key) {
|
|
439
|
-
const
|
|
456
|
+
const subOptions = resolveSubOptions(options, key);
|
|
440
457
|
return {
|
|
441
|
-
..."overrides" in
|
|
458
|
+
..."overrides" in subOptions && subOptions.overrides ? subOptions.overrides : {}
|
|
442
459
|
};
|
|
443
460
|
}
|
|
444
461
|
function isInEditorEnv() {
|
|
@@ -540,7 +557,7 @@ function node() {
|
|
|
540
557
|
{
|
|
541
558
|
name: "coderwyd/node/rules",
|
|
542
559
|
plugins: {
|
|
543
|
-
node:
|
|
560
|
+
node: default5
|
|
544
561
|
},
|
|
545
562
|
rules: {
|
|
546
563
|
"node/handle-callback-err": ["error", "^(err|error)$"],
|
|
@@ -563,7 +580,7 @@ function perfectionist() {
|
|
|
563
580
|
{
|
|
564
581
|
name: "coderwyd/perfectionist/rules",
|
|
565
582
|
plugins: {
|
|
566
|
-
perfectionist:
|
|
583
|
+
perfectionist: default6
|
|
567
584
|
},
|
|
568
585
|
rules: {
|
|
569
586
|
"perfectionist/sort-exports": [
|
|
@@ -1438,7 +1455,7 @@ function unicorn() {
|
|
|
1438
1455
|
{
|
|
1439
1456
|
name: "coderwyd/unicorn/rules",
|
|
1440
1457
|
plugins: {
|
|
1441
|
-
unicorn:
|
|
1458
|
+
unicorn: default7
|
|
1442
1459
|
},
|
|
1443
1460
|
rules: {
|
|
1444
1461
|
// 'unicorn/better-regex': 'error',
|
|
@@ -1464,7 +1481,7 @@ function unicorn() {
|
|
|
1464
1481
|
"unicorn/no-console-spaces": "error",
|
|
1465
1482
|
"unicorn/no-for-loop": "error",
|
|
1466
1483
|
"unicorn/no-hex-escape": "error",
|
|
1467
|
-
"unicorn/no-instanceof-
|
|
1484
|
+
"unicorn/no-instanceof-builtins": "error",
|
|
1468
1485
|
"unicorn/no-invalid-remove-event-listener": "error",
|
|
1469
1486
|
"unicorn/no-length-as-slice-end": "error",
|
|
1470
1487
|
"unicorn/no-lonely-if": "error",
|
|
@@ -1758,8 +1775,9 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1758
1775
|
imports(),
|
|
1759
1776
|
unicorn(),
|
|
1760
1777
|
command(),
|
|
1761
|
-
|
|
1778
|
+
deMorgan(),
|
|
1762
1779
|
perfectionist()
|
|
1780
|
+
// Optional plugins (installed but not enabled by default)
|
|
1763
1781
|
);
|
|
1764
1782
|
if (enableVue) componentExts.push("vue");
|
|
1765
1783
|
if (enableTypeScript) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coderwyd/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.1.1",
|
|
5
5
|
"description": "Donny's ESLint config",
|
|
6
6
|
"author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -69,58 +69,59 @@
|
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@antfu/install-pkg": "^1.0.0",
|
|
71
71
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
72
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
73
|
-
"@typescript-eslint/parser": "^8.
|
|
74
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
75
|
-
"eslint-config-flat-gitignore": "^2.
|
|
76
|
-
"eslint-config-prettier": "^10.0.
|
|
77
|
-
"eslint-plugin-antfu": "^3.
|
|
78
|
-
"eslint-plugin-command": "^3.
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^8.25.0",
|
|
73
|
+
"@typescript-eslint/parser": "^8.25.0",
|
|
74
|
+
"@vitest/eslint-plugin": "^1.1.36",
|
|
75
|
+
"eslint-config-flat-gitignore": "^2.1.0",
|
|
76
|
+
"eslint-config-prettier": "^10.0.2",
|
|
77
|
+
"eslint-plugin-antfu": "^3.1.0",
|
|
78
|
+
"eslint-plugin-command": "^3.1.0",
|
|
79
|
+
"eslint-plugin-de-morgan": "^1.2.0",
|
|
79
80
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
80
81
|
"eslint-plugin-import-x": "^4.6.1",
|
|
81
82
|
"eslint-plugin-jsdoc": "^50.6.3",
|
|
82
83
|
"eslint-plugin-jsonc": "^2.19.1",
|
|
83
|
-
"eslint-plugin-n": "^17.
|
|
84
|
+
"eslint-plugin-n": "^17.16.1",
|
|
84
85
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
85
|
-
"eslint-plugin-perfectionist": "^4.
|
|
86
|
+
"eslint-plugin-perfectionist": "^4.9.0",
|
|
86
87
|
"eslint-plugin-regexp": "^2.7.0",
|
|
87
|
-
"eslint-plugin-unicorn": "^
|
|
88
|
+
"eslint-plugin-unicorn": "^57.0.0",
|
|
88
89
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
89
90
|
"eslint-plugin-vue": "^9.32.0",
|
|
90
|
-
"eslint-typegen": "^
|
|
91
|
-
"globals": "^
|
|
91
|
+
"eslint-typegen": "^2.0.0",
|
|
92
|
+
"globals": "^16.0.0",
|
|
92
93
|
"jsonc-eslint-parser": "^2.4.0",
|
|
93
|
-
"local-pkg": "^1.
|
|
94
|
+
"local-pkg": "^1.1.0",
|
|
94
95
|
"parse-gitignore": "^2.0.0",
|
|
95
96
|
"picocolors": "^1.1.1",
|
|
96
|
-
"prettier": "^3.
|
|
97
|
+
"prettier": "^3.5.3",
|
|
97
98
|
"prompts": "^2.4.2",
|
|
98
99
|
"vue-eslint-parser": "^9.4.3",
|
|
99
100
|
"yargs": "^17.7.2"
|
|
100
101
|
},
|
|
101
102
|
"devDependencies": {
|
|
102
103
|
"@antfu/ni": "^23.3.1",
|
|
103
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
104
|
-
"@eslint/config-inspector": "^1.0.
|
|
104
|
+
"@eslint-react/eslint-plugin": "^1.29.0",
|
|
105
|
+
"@eslint/config-inspector": "^1.0.1",
|
|
105
106
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
106
|
-
"@types/node": "^22.13.
|
|
107
|
+
"@types/node": "^22.13.8",
|
|
107
108
|
"@types/prompts": "^2.4.9",
|
|
108
109
|
"@types/yargs": "^17.0.33",
|
|
109
|
-
"@unocss/eslint-plugin": "^
|
|
110
|
-
"bumpp": "^10.0.
|
|
111
|
-
"eslint": "^9.
|
|
110
|
+
"@unocss/eslint-plugin": "^66.1.0-beta.3",
|
|
111
|
+
"bumpp": "^10.0.3",
|
|
112
|
+
"eslint": "^9.21.0",
|
|
112
113
|
"eslint-plugin-react-compiler": "19.0.0-beta-e552027-20250112",
|
|
113
|
-
"eslint-plugin-react-hooks": "^5.
|
|
114
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
115
|
-
"eslint-plugin-svelte": "^
|
|
114
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
115
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
116
|
+
"eslint-plugin-svelte": "^3.0.2",
|
|
116
117
|
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
117
118
|
"jiti": "^2.4.2",
|
|
118
119
|
"nano-staged": "^0.8.0",
|
|
119
120
|
"simple-git-hooks": "^2.11.1",
|
|
120
|
-
"svelte": "^5.
|
|
121
|
-
"svelte-eslint-parser": "^0.
|
|
122
|
-
"tsup": "^8.
|
|
123
|
-
"typescript": "^5.
|
|
121
|
+
"svelte": "^5.20.5",
|
|
122
|
+
"svelte-eslint-parser": "^1.0.0",
|
|
123
|
+
"tsup": "^8.4.0",
|
|
124
|
+
"typescript": "^5.8.2"
|
|
124
125
|
},
|
|
125
126
|
"simple-git-hooks": {
|
|
126
127
|
"pre-commit": "pnpm exec nano-staged"
|