@coderwyd/eslint-config 4.2.0 → 4.2.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 +9 -9
- package/dist/index.d.ts +298 -275
- package/dist/index.js +59 -51
- package/package.json +15 -15
package/dist/index.js
CHANGED
|
@@ -134,6 +134,7 @@ function imports() {
|
|
|
134
134
|
"antfu/no-import-node-modules-by-path": "error",
|
|
135
135
|
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
136
136
|
"import/first": "error",
|
|
137
|
+
"import/newline-after-import": ["error", { count: 1 }],
|
|
137
138
|
"import/no-duplicates": "error",
|
|
138
139
|
"import/no-mutable-exports": "error",
|
|
139
140
|
"import/no-named-default": "error",
|
|
@@ -727,22 +728,73 @@ async function react(options = {}) {
|
|
|
727
728
|
name: "coderwyd/react/rules",
|
|
728
729
|
rules: {
|
|
729
730
|
"react-compiler/react-compiler": "warn",
|
|
730
|
-
// recommended rules from
|
|
731
|
-
"react
|
|
731
|
+
// recommended rules from eslint-plugin-react-x https://eslint-react.xyz/docs/rules/overview#core-rules
|
|
732
|
+
"react/no-access-state-in-setstate": "error",
|
|
733
|
+
"react/no-array-index-key": "warn",
|
|
734
|
+
"react/no-children-count": "warn",
|
|
735
|
+
"react/no-children-for-each": "warn",
|
|
736
|
+
"react/no-children-map": "warn",
|
|
737
|
+
"react/no-children-only": "warn",
|
|
738
|
+
"react/no-children-to-array": "warn",
|
|
739
|
+
"react/no-clone-element": "warn",
|
|
740
|
+
"react/no-comment-textnodes": "warn",
|
|
741
|
+
"react/no-component-will-mount": "error",
|
|
742
|
+
"react/no-component-will-receive-props": "error",
|
|
743
|
+
"react/no-component-will-update": "error",
|
|
744
|
+
"react/no-context-provider": "warn",
|
|
745
|
+
"react/no-create-ref": "error",
|
|
746
|
+
"react/no-default-props": "error",
|
|
747
|
+
"react/no-direct-mutation-state": "error",
|
|
748
|
+
"react/no-duplicate-jsx-props": "warn",
|
|
749
|
+
"react/no-duplicate-key": "warn",
|
|
750
|
+
"react/no-forward-ref": "warn",
|
|
751
|
+
"react/no-implicit-key": "warn",
|
|
752
|
+
"react/no-missing-key": "error",
|
|
753
|
+
"react/no-nested-component-definitions": "error",
|
|
754
|
+
"react/no-prop-types": "error",
|
|
755
|
+
"react/no-redundant-should-component-update": "error",
|
|
756
|
+
"react/no-set-state-in-component-did-mount": "warn",
|
|
757
|
+
"react/no-set-state-in-component-did-update": "warn",
|
|
758
|
+
"react/no-set-state-in-component-will-update": "warn",
|
|
759
|
+
"react/no-string-refs": "error",
|
|
760
|
+
"react/no-unsafe-component-will-mount": "warn",
|
|
761
|
+
"react/no-unsafe-component-will-receive-props": "warn",
|
|
762
|
+
"react/no-unsafe-component-will-update": "warn",
|
|
763
|
+
"react/no-unstable-context-value": "warn",
|
|
764
|
+
"react/no-unstable-default-props": "warn",
|
|
765
|
+
"react/no-unused-class-component-members": "warn",
|
|
766
|
+
"react/no-unused-state": "warn",
|
|
767
|
+
"react/no-use-context": "warn",
|
|
768
|
+
"react/no-useless-forward-ref": "warn",
|
|
769
|
+
"react/use-jsx-vars": "warn",
|
|
770
|
+
// recommended rules from eslint-plugin-react-dom https://eslint-react.xyz/docs/rules/overview#dom-rules
|
|
732
771
|
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
733
772
|
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
734
773
|
"react-dom/no-find-dom-node": "error",
|
|
774
|
+
"react-dom/no-flush-sync": "error",
|
|
775
|
+
"react-dom/no-hydrate": "error",
|
|
735
776
|
"react-dom/no-missing-button-type": "warn",
|
|
736
777
|
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
737
778
|
"react-dom/no-namespace": "error",
|
|
779
|
+
"react-dom/no-render": "error",
|
|
738
780
|
"react-dom/no-render-return-value": "error",
|
|
739
781
|
"react-dom/no-script-url": "warn",
|
|
740
782
|
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
741
783
|
"react-dom/no-unsafe-target-blank": "warn",
|
|
742
|
-
|
|
784
|
+
"react-dom/no-use-form-state": "error",
|
|
785
|
+
"react-dom/no-void-elements-with-children": "error",
|
|
786
|
+
// recommended rules eslint-plugin-react-hooks https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks/src/rules
|
|
743
787
|
"react-hooks/exhaustive-deps": "warn",
|
|
744
788
|
"react-hooks/rules-of-hooks": "error",
|
|
745
|
-
// react
|
|
789
|
+
// recommended rules from eslint-plugin-react-hooks-extra https://eslint-react.xyz/docs/rules/overview#hooks-extra-rules
|
|
790
|
+
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
791
|
+
"react-hooks-extra/no-unnecessary-use-prefix": "warn",
|
|
792
|
+
// recommended rules from eslint-plugin-react-web-api https://eslint-react.xyz/docs/rules/overview#web-api-rules
|
|
793
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
794
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
795
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
796
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
797
|
+
// preconfigured rules from eslint-plugin-react-refresh https://github.com/ArnaudBarre/eslint-plugin-react-refresh/tree/main/src
|
|
746
798
|
"react-refresh/only-export-components": [
|
|
747
799
|
"warn",
|
|
748
800
|
{
|
|
@@ -767,52 +819,6 @@ async function react(options = {}) {
|
|
|
767
819
|
]
|
|
768
820
|
}
|
|
769
821
|
],
|
|
770
|
-
// recommended rules from @eslint-react/web-api
|
|
771
|
-
"react-web-api/no-leaked-event-listener": "warn",
|
|
772
|
-
"react-web-api/no-leaked-interval": "warn",
|
|
773
|
-
"react-web-api/no-leaked-resize-observer": "warn",
|
|
774
|
-
"react-web-api/no-leaked-timeout": "warn",
|
|
775
|
-
// recommended rules from @eslint-react
|
|
776
|
-
"react/ensure-forward-ref-using-ref": "warn",
|
|
777
|
-
"react/jsx-no-duplicate-props": "warn",
|
|
778
|
-
"react/jsx-uses-vars": "warn",
|
|
779
|
-
"react/no-access-state-in-setstate": "error",
|
|
780
|
-
"react/no-array-index-key": "warn",
|
|
781
|
-
"react/no-children-count": "warn",
|
|
782
|
-
"react/no-children-for-each": "warn",
|
|
783
|
-
"react/no-children-map": "warn",
|
|
784
|
-
"react/no-children-only": "warn",
|
|
785
|
-
"react/no-children-to-array": "warn",
|
|
786
|
-
"react/no-clone-element": "warn",
|
|
787
|
-
"react/no-comment-textnodes": "warn",
|
|
788
|
-
"react/no-component-will-mount": "error",
|
|
789
|
-
"react/no-component-will-receive-props": "error",
|
|
790
|
-
"react/no-component-will-update": "error",
|
|
791
|
-
"react/no-context-provider": "warn",
|
|
792
|
-
"react/no-create-ref": "error",
|
|
793
|
-
"react/no-default-props": "error",
|
|
794
|
-
"react/no-direct-mutation-state": "error",
|
|
795
|
-
"react/no-duplicate-key": "error",
|
|
796
|
-
"react/no-forward-ref": "warn",
|
|
797
|
-
"react/no-implicit-key": "warn",
|
|
798
|
-
"react/no-missing-key": "error",
|
|
799
|
-
"react/no-nested-components": "error",
|
|
800
|
-
"react/no-prop-types": "error",
|
|
801
|
-
"react/no-redundant-should-component-update": "error",
|
|
802
|
-
"react/no-set-state-in-component-did-mount": "warn",
|
|
803
|
-
"react/no-set-state-in-component-did-update": "warn",
|
|
804
|
-
"react/no-set-state-in-component-will-update": "warn",
|
|
805
|
-
"react/no-string-refs": "error",
|
|
806
|
-
"react/no-unsafe-component-will-mount": "warn",
|
|
807
|
-
"react/no-unsafe-component-will-receive-props": "warn",
|
|
808
|
-
"react/no-unsafe-component-will-update": "warn",
|
|
809
|
-
"react/no-unstable-context-value": "warn",
|
|
810
|
-
"react/no-unstable-default-props": "warn",
|
|
811
|
-
"react/no-unused-class-component-members": "warn",
|
|
812
|
-
"react/no-unused-state": "warn",
|
|
813
|
-
"react/prefer-destructuring-assignment": "warn",
|
|
814
|
-
"react/prefer-shorthand-boolean": "warn",
|
|
815
|
-
"react/prefer-shorthand-fragment": "warn",
|
|
816
822
|
// overrides
|
|
817
823
|
...overrides
|
|
818
824
|
}
|
|
@@ -821,7 +827,7 @@ async function react(options = {}) {
|
|
|
821
827
|
{
|
|
822
828
|
files: filesTypeAware,
|
|
823
829
|
ignores: ignoresTypeAware,
|
|
824
|
-
name: "
|
|
830
|
+
name: "antfu/react/type-aware-rules",
|
|
825
831
|
rules: {
|
|
826
832
|
...typeAwareRules
|
|
827
833
|
}
|
|
@@ -993,6 +999,7 @@ function sortTsconfig() {
|
|
|
993
999
|
"useDefineForClassFields",
|
|
994
1000
|
"emitDecoratorMetadata",
|
|
995
1001
|
"experimentalDecorators",
|
|
1002
|
+
"libReplacement",
|
|
996
1003
|
/* Modules */
|
|
997
1004
|
"baseUrl",
|
|
998
1005
|
"rootDir",
|
|
@@ -1067,6 +1074,7 @@ function sortTsconfig() {
|
|
|
1067
1074
|
"isolatedModules",
|
|
1068
1075
|
"preserveSymlinks",
|
|
1069
1076
|
"verbatimModuleSyntax",
|
|
1077
|
+
"erasableSyntaxOnly",
|
|
1070
1078
|
/* Completeness */
|
|
1071
1079
|
"skipDefaultLibCheck",
|
|
1072
1080
|
"skipLibCheck"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coderwyd/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.2.
|
|
4
|
+
"version": "4.2.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,23 +69,23 @@
|
|
|
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.
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^8.28.0",
|
|
73
|
+
"@typescript-eslint/parser": "^8.28.0",
|
|
74
74
|
"@vitest/eslint-plugin": "^1.1.38",
|
|
75
75
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
76
76
|
"eslint-config-prettier": "^10.1.1",
|
|
77
77
|
"eslint-plugin-antfu": "^3.1.1",
|
|
78
|
-
"eslint-plugin-command": "^3.
|
|
78
|
+
"eslint-plugin-command": "^3.2.0",
|
|
79
79
|
"eslint-plugin-de-morgan": "^1.2.1",
|
|
80
80
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
81
|
-
"eslint-plugin-import-x": "^4.
|
|
82
|
-
"eslint-plugin-jsdoc": "^50.6.
|
|
81
|
+
"eslint-plugin-import-x": "^4.9.1",
|
|
82
|
+
"eslint-plugin-jsdoc": "^50.6.9",
|
|
83
83
|
"eslint-plugin-jsonc": "^2.19.1",
|
|
84
84
|
"eslint-plugin-n": "^17.16.2",
|
|
85
85
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
86
86
|
"eslint-plugin-perfectionist": "^4.10.1",
|
|
87
87
|
"eslint-plugin-regexp": "^2.7.0",
|
|
88
|
-
"eslint-plugin-unicorn": "^
|
|
88
|
+
"eslint-plugin-unicorn": "^58.0.0",
|
|
89
89
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
90
90
|
"eslint-plugin-vue": "^10.0.0",
|
|
91
91
|
"eslint-plugin-yml": "^1.17.0",
|
|
@@ -102,25 +102,25 @@
|
|
|
102
102
|
"yargs": "^17.7.2"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
|
-
"@antfu/ni": "^24.
|
|
106
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
105
|
+
"@antfu/ni": "^24.3.0",
|
|
106
|
+
"@eslint-react/eslint-plugin": "^1.38.0",
|
|
107
107
|
"@eslint/config-inspector": "^1.0.2",
|
|
108
108
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
109
|
-
"@types/node": "^22.13.
|
|
109
|
+
"@types/node": "^22.13.13",
|
|
110
110
|
"@types/prompts": "^2.4.9",
|
|
111
111
|
"@types/yargs": "^17.0.33",
|
|
112
|
-
"@unocss/eslint-plugin": "^66.1.0-beta.
|
|
112
|
+
"@unocss/eslint-plugin": "^66.1.0-beta.6",
|
|
113
113
|
"bumpp": "^10.1.0",
|
|
114
|
-
"eslint": "^9.
|
|
114
|
+
"eslint": "^9.23.0",
|
|
115
115
|
"eslint-plugin-react-compiler": "19.0.0-beta-e552027-20250112",
|
|
116
116
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
117
117
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
118
|
-
"eslint-plugin-svelte": "^3.3.
|
|
118
|
+
"eslint-plugin-svelte": "^3.3.3",
|
|
119
119
|
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
120
120
|
"jiti": "^2.4.2",
|
|
121
121
|
"nano-staged": "^0.8.0",
|
|
122
|
-
"simple-git-hooks": "^2.
|
|
123
|
-
"svelte": "^5.
|
|
122
|
+
"simple-git-hooks": "^2.12.1",
|
|
123
|
+
"svelte": "^5.25.3",
|
|
124
124
|
"svelte-eslint-parser": "^1.1.0",
|
|
125
125
|
"tsup": "^8.4.0",
|
|
126
126
|
"typescript": "^5.8.2"
|