@coderwyd/eslint-config 3.4.0 → 3.6.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/dist/cli.cjs +15 -20
- package/dist/cli.js +15 -20
- package/dist/index.cjs +29 -10
- package/dist/index.d.cts +464 -147
- package/dist/index.d.ts +464 -147
- package/dist/index.js +28 -9
- package/package.json +40 -42
package/dist/index.js
CHANGED
|
@@ -653,9 +653,16 @@ var RemixPackages = [
|
|
|
653
653
|
"@remix-run/serve",
|
|
654
654
|
"@remix-run/dev"
|
|
655
655
|
];
|
|
656
|
+
var ReactRouterPackages = [
|
|
657
|
+
"@react-router/node",
|
|
658
|
+
"@react-router/react",
|
|
659
|
+
"@react-router/serve",
|
|
660
|
+
"@react-router/dev"
|
|
661
|
+
];
|
|
656
662
|
var NextJsPackages = ["next"];
|
|
657
663
|
var ReactRefreshAllowConstantExportPackages = ["vite"];
|
|
658
664
|
var isUsingRemix = hasPackages(RemixPackages);
|
|
665
|
+
var isUsingReactRouter = hasPackages(ReactRouterPackages);
|
|
659
666
|
var isUsingNext = hasPackages(NextJsPackages);
|
|
660
667
|
var isAllowConstantExport = hasPackages(
|
|
661
668
|
ReactRefreshAllowConstantExportPackages
|
|
@@ -682,24 +689,30 @@ async function react(options = {}) {
|
|
|
682
689
|
const typeAwareRules = {
|
|
683
690
|
"react/no-leaked-conditional-rendering": "warn"
|
|
684
691
|
};
|
|
685
|
-
const [
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
+
const [
|
|
693
|
+
pluginReact,
|
|
694
|
+
pluginReactHooks,
|
|
695
|
+
pluginReactRefresh,
|
|
696
|
+
pluginReactCompiler
|
|
697
|
+
] = await Promise.all([
|
|
698
|
+
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
699
|
+
interopDefault(import("eslint-plugin-react-hooks")),
|
|
700
|
+
interopDefault(import("eslint-plugin-react-refresh")),
|
|
701
|
+
interopDefault(import("eslint-plugin-react-compiler"))
|
|
702
|
+
]);
|
|
692
703
|
const plugins = pluginReact.configs.all.plugins;
|
|
693
704
|
return [
|
|
694
705
|
{
|
|
695
706
|
name: "coderwyd/react/setup",
|
|
696
707
|
plugins: {
|
|
697
708
|
react: plugins["@eslint-react"],
|
|
709
|
+
"react-compiler": pluginReactCompiler,
|
|
698
710
|
"react-dom": plugins["@eslint-react/dom"],
|
|
699
711
|
"react-hooks": pluginReactHooks,
|
|
700
712
|
"react-hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
701
713
|
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
702
|
-
"react-refresh": pluginReactRefresh
|
|
714
|
+
"react-refresh": pluginReactRefresh,
|
|
715
|
+
"react-web-api": plugins["@eslint-react/web-api"]
|
|
703
716
|
}
|
|
704
717
|
},
|
|
705
718
|
{
|
|
@@ -714,6 +727,7 @@ async function react(options = {}) {
|
|
|
714
727
|
},
|
|
715
728
|
name: "coderwyd/react/rules",
|
|
716
729
|
rules: {
|
|
730
|
+
"react-compiler/react-compiler": "warn",
|
|
717
731
|
// recommended rules from @eslint-react/dom
|
|
718
732
|
"react-dom/no-children-in-void-dom-elements": "warn",
|
|
719
733
|
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
@@ -750,10 +764,15 @@ async function react(options = {}) {
|
|
|
750
764
|
"viewport",
|
|
751
765
|
"generateViewport"
|
|
752
766
|
] : [],
|
|
753
|
-
...isUsingRemix ? ["meta", "links", "headers", "loader", "action"] : []
|
|
767
|
+
...isUsingRemix || isUsingReactRouter ? ["meta", "links", "headers", "loader", "action"] : []
|
|
754
768
|
]
|
|
755
769
|
}
|
|
756
770
|
],
|
|
771
|
+
// recommended rules from @eslint-react/web-api
|
|
772
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
773
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
774
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
775
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
757
776
|
// recommended rules from @eslint-react
|
|
758
777
|
"react/ensure-forward-ref-using-ref": "warn",
|
|
759
778
|
"react/jsx-no-duplicate-props": "warn",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coderwyd/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.6.0",
|
|
5
5
|
"description": "Donny's ESLint config",
|
|
6
6
|
"author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"@eslint-react/eslint-plugin": "^1.5.8",
|
|
39
39
|
"@unocss/eslint-plugin": ">=0.50.0",
|
|
40
40
|
"eslint": "^9.5.0",
|
|
41
|
+
"eslint-plugin-react-compiler": "^19.0.0-beta-decd7b8-20250118",
|
|
41
42
|
"eslint-plugin-react-hooks": "^4.6.0 || ^5.0.0",
|
|
42
43
|
"eslint-plugin-react-refresh": "^0.4.4",
|
|
43
44
|
"eslint-plugin-svelte": ">=2.35.1",
|
|
@@ -51,6 +52,9 @@
|
|
|
51
52
|
"@unocss/eslint-plugin": {
|
|
52
53
|
"optional": true
|
|
53
54
|
},
|
|
55
|
+
"eslint-plugin-react-compiler": {
|
|
56
|
+
"optional": true
|
|
57
|
+
},
|
|
54
58
|
"eslint-plugin-react-hooks": {
|
|
55
59
|
"optional": true
|
|
56
60
|
},
|
|
@@ -68,31 +72,30 @@
|
|
|
68
72
|
}
|
|
69
73
|
},
|
|
70
74
|
"dependencies": {
|
|
71
|
-
"@antfu/install-pkg": "^0.
|
|
75
|
+
"@antfu/install-pkg": "^1.0.0",
|
|
72
76
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
73
|
-
"@
|
|
74
|
-
"@typescript-eslint/
|
|
75
|
-
"@
|
|
76
|
-
"
|
|
77
|
-
"eslint-config-
|
|
78
|
-
"eslint-config-prettier": "^9.1.0",
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^8.20.0",
|
|
78
|
+
"@typescript-eslint/parser": "^8.20.0",
|
|
79
|
+
"@vitest/eslint-plugin": "^1.1.25",
|
|
80
|
+
"eslint-config-flat-gitignore": "^1.0.0",
|
|
81
|
+
"eslint-config-prettier": "^10.0.1",
|
|
79
82
|
"eslint-plugin-antfu": "^2.7.0",
|
|
80
|
-
"eslint-plugin-command": "^
|
|
83
|
+
"eslint-plugin-command": "^2.1.0",
|
|
81
84
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
82
|
-
"eslint-plugin-import-x": "^4.
|
|
83
|
-
"eslint-plugin-jsdoc": "^50.6.
|
|
85
|
+
"eslint-plugin-import-x": "^4.6.1",
|
|
86
|
+
"eslint-plugin-jsdoc": "^50.6.2",
|
|
84
87
|
"eslint-plugin-jsonc": "^2.18.2",
|
|
85
|
-
"eslint-plugin-n": "^17.15.
|
|
88
|
+
"eslint-plugin-n": "^17.15.1",
|
|
86
89
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
87
|
-
"eslint-plugin-perfectionist": "^4.
|
|
90
|
+
"eslint-plugin-perfectionist": "^4.6.0",
|
|
88
91
|
"eslint-plugin-regexp": "^2.7.0",
|
|
89
92
|
"eslint-plugin-unicorn": "^56.0.1",
|
|
90
93
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
91
94
|
"eslint-plugin-vue": "^9.32.0",
|
|
92
|
-
"eslint-typegen": "^0.
|
|
93
|
-
"globals": "^15.
|
|
95
|
+
"eslint-typegen": "^1.0.0",
|
|
96
|
+
"globals": "^15.14.0",
|
|
94
97
|
"jsonc-eslint-parser": "^2.4.0",
|
|
95
|
-
"local-pkg": "^0.
|
|
98
|
+
"local-pkg": "^1.0.0",
|
|
96
99
|
"parse-gitignore": "^2.0.0",
|
|
97
100
|
"picocolors": "^1.1.1",
|
|
98
101
|
"prettier": "^3.4.2",
|
|
@@ -101,47 +104,42 @@
|
|
|
101
104
|
"yargs": "^17.7.2"
|
|
102
105
|
},
|
|
103
106
|
"devDependencies": {
|
|
104
|
-
"@antfu/ni": "^
|
|
105
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
106
|
-
"@eslint/config-inspector": "^0.
|
|
107
|
+
"@antfu/ni": "^23.2.0",
|
|
108
|
+
"@eslint-react/eslint-plugin": "^1.23.2",
|
|
109
|
+
"@eslint/config-inspector": "^1.0.0",
|
|
107
110
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
108
|
-
"@types/
|
|
109
|
-
"@types/node": "^22.10.2",
|
|
111
|
+
"@types/node": "^22.10.7",
|
|
110
112
|
"@types/prompts": "^2.4.9",
|
|
111
113
|
"@types/yargs": "^17.0.33",
|
|
112
|
-
"@unocss/eslint-plugin": "^
|
|
113
|
-
"bumpp": "^9.
|
|
114
|
-
"eslint": "^9.
|
|
114
|
+
"@unocss/eslint-plugin": "^65.4.2",
|
|
115
|
+
"bumpp": "^9.10.1",
|
|
116
|
+
"eslint": "^9.18.0",
|
|
117
|
+
"eslint-plugin-react-compiler": "19.0.0-beta-decd7b8-20250118",
|
|
115
118
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
116
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
119
|
+
"eslint-plugin-react-refresh": "^0.4.18",
|
|
117
120
|
"eslint-plugin-svelte": "^2.46.1",
|
|
118
|
-
"eslint-plugin-tailwindcss": "^3.
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"fs-extra": "^11.2.0",
|
|
122
|
-
"jiti": "^2.4.1",
|
|
123
|
-
"lint-staged": "^15.2.11",
|
|
124
|
-
"rimraf": "^6.0.1",
|
|
121
|
+
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
122
|
+
"jiti": "^2.4.2",
|
|
123
|
+
"nano-staged": "^0.8.0",
|
|
125
124
|
"simple-git-hooks": "^2.11.1",
|
|
126
|
-
"svelte": "^5.
|
|
125
|
+
"svelte": "^5.19.0",
|
|
127
126
|
"svelte-eslint-parser": "^0.43.0",
|
|
128
127
|
"tsup": "^8.3.5",
|
|
129
|
-
"
|
|
130
|
-
"typescript": "^5.7.2"
|
|
128
|
+
"typescript": "^5.7.3"
|
|
131
129
|
},
|
|
132
130
|
"simple-git-hooks": {
|
|
133
|
-
"pre-commit": "
|
|
131
|
+
"pre-commit": "pnpm exec nano-staged"
|
|
134
132
|
},
|
|
135
133
|
"nano-staged": {
|
|
136
|
-
"*": "eslint --
|
|
134
|
+
"*": "eslint --fix"
|
|
137
135
|
},
|
|
138
136
|
"scripts": {
|
|
139
137
|
"build": "nr build:typegen && tsup",
|
|
140
|
-
"dev": "
|
|
141
|
-
"lint": "eslint
|
|
142
|
-
"lint:fix": "eslint
|
|
143
|
-
"build:inspector": "pnpm build &&
|
|
144
|
-
"build:typegen": "
|
|
138
|
+
"dev": "pnpx @eslint/config-inspector",
|
|
139
|
+
"lint": "eslint .",
|
|
140
|
+
"lint:fix": "eslint . --fix",
|
|
141
|
+
"build:inspector": "pnpm build && pnpx @eslint/config-inspector build",
|
|
142
|
+
"build:typegen": "jiti scripts/typegen.ts",
|
|
145
143
|
"release": "bumpp && pnpm publish",
|
|
146
144
|
"typecheck": "tsc --noEmit"
|
|
147
145
|
}
|