@eslint-react/eslint-plugin 1.8.3-next.6 → 1.9.0-beta.3
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 +12 -4
- package/dist/index.d.mts +419 -279
- package/dist/index.d.ts +419 -279
- package/dist/index.js +33 -51
- package/dist/index.mjs +33 -51
- package/package.json +15 -15
package/dist/index.js
CHANGED
|
@@ -38,7 +38,7 @@ var R__namespace = /*#__PURE__*/_interopNamespace(R);
|
|
|
38
38
|
|
|
39
39
|
// package.json
|
|
40
40
|
var name = "@eslint-react/eslint-plugin";
|
|
41
|
-
var version = "1.
|
|
41
|
+
var version = "1.9.0-beta.3";
|
|
42
42
|
function transformKeys(obj, transform) {
|
|
43
43
|
if (tools.typeOf(obj) !== "object") return obj;
|
|
44
44
|
const res = {};
|
|
@@ -77,10 +77,8 @@ var allPreset = {
|
|
|
77
77
|
"no-default-props": "error",
|
|
78
78
|
"no-direct-mutation-state": "error",
|
|
79
79
|
"no-duplicate-key": "error",
|
|
80
|
-
// This rule has been deprecated
|
|
81
80
|
// "no-implicit-key": "error",
|
|
82
|
-
// This rule requires type information
|
|
83
|
-
// "no-leaked-conditional-rendering": "warn",
|
|
81
|
+
// "no-leaked-conditional-rendering": "warn", // This rule requires type information
|
|
84
82
|
"no-missing-component-display-name": "warn",
|
|
85
83
|
"no-missing-key": "error",
|
|
86
84
|
"no-nested-components": "warn",
|
|
@@ -99,8 +97,7 @@ var allPreset = {
|
|
|
99
97
|
"no-unused-state": "warn",
|
|
100
98
|
"no-useless-fragment": "warn",
|
|
101
99
|
"prefer-destructuring-assignment": "warn",
|
|
102
|
-
// This rule requires type information
|
|
103
|
-
// "prefer-read-only-props": "warn",
|
|
100
|
+
// "prefer-read-only-props": "warn", // This rule requires type information
|
|
104
101
|
"prefer-shorthand-boolean": "warn",
|
|
105
102
|
"prefer-shorthand-fragment": "warn",
|
|
106
103
|
// eslint-disable-next-line perfectionist/sort-objects
|
|
@@ -115,19 +112,12 @@ var allPreset = {
|
|
|
115
112
|
"dom/no-script-url": "warn",
|
|
116
113
|
"dom/no-unsafe-iframe-sandbox": "warn",
|
|
117
114
|
"dom/no-unsafe-target-blank": "warn",
|
|
118
|
-
"hooks-extra/ensure-custom-hooks-using-other-hooks": "warn",
|
|
119
|
-
"hooks-extra/ensure-use-callback-has-non-empty-deps": "warn",
|
|
120
|
-
"hooks-extra/ensure-use-memo-has-non-empty-deps": "warn",
|
|
121
|
-
"hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
122
|
-
"hooks-extra/no-direct-set-state-in-use-layout-effect": "warn",
|
|
123
|
-
"hooks-extra/prefer-use-state-lazy-initialization": "warn",
|
|
124
115
|
"naming-convention/component-name": "warn",
|
|
125
116
|
"naming-convention/filename": "warn",
|
|
126
117
|
"naming-convention/filename-extension": "warn",
|
|
127
118
|
"naming-convention/use-state": "warn"
|
|
128
119
|
};
|
|
129
|
-
var
|
|
130
|
-
// Part: react rules
|
|
120
|
+
var corePreset = {
|
|
131
121
|
// "avoid-shorthand-boolean": "warn",
|
|
132
122
|
// "avoid-shorthand-fragment": "warn",
|
|
133
123
|
"ensure-forward-ref-using-ref": "warn",
|
|
@@ -167,13 +157,14 @@ var recommendedPreset = {
|
|
|
167
157
|
"no-unstable-context-value": "error",
|
|
168
158
|
"no-unstable-default-props": "error",
|
|
169
159
|
"no-unused-class-component-members": "warn",
|
|
170
|
-
"no-unused-state": "warn"
|
|
160
|
+
"no-unused-state": "warn"
|
|
171
161
|
// "no-useless-fragment": "warn",
|
|
172
162
|
// "prefer-read-only-props": "warn",
|
|
173
163
|
// "prefer-destructuring-assignment": "warn",
|
|
174
164
|
// "prefer-shorthand-boolean": "warn",
|
|
175
165
|
// "prefer-shorthand-fragment": "warn",
|
|
176
|
-
|
|
166
|
+
};
|
|
167
|
+
var domPreset = {
|
|
177
168
|
"dom/no-children-in-void-dom-elements": "warn",
|
|
178
169
|
"dom/no-dangerously-set-innerhtml": "warn",
|
|
179
170
|
"dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
@@ -184,33 +175,21 @@ var recommendedPreset = {
|
|
|
184
175
|
"dom/no-render-return-value": "error",
|
|
185
176
|
"dom/no-script-url": "warn",
|
|
186
177
|
"dom/no-unsafe-iframe-sandbox": "warn",
|
|
187
|
-
"dom/no-unsafe-target-blank": "warn"
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
// "hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
193
|
-
// "hooks-extra/no-direct-set-state-in-use-layout-effect": "warn",
|
|
194
|
-
"hooks-extra/prefer-use-state-lazy-initialization": "warn"
|
|
178
|
+
"dom/no-unsafe-target-blank": "warn"
|
|
179
|
+
};
|
|
180
|
+
var recommendedPreset = {
|
|
181
|
+
...corePreset,
|
|
182
|
+
...domPreset
|
|
195
183
|
};
|
|
196
184
|
var recommendedTypeCheckedPreset = {
|
|
197
185
|
...recommendedPreset,
|
|
198
186
|
"no-leaked-conditional-rendering": "warn"
|
|
199
187
|
};
|
|
200
|
-
var
|
|
201
|
-
|
|
202
|
-
"dom/no-dangerously-set-innerhtml": "warn",
|
|
203
|
-
"dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
204
|
-
"dom/no-find-dom-node": "error",
|
|
205
|
-
"dom/no-missing-button-type": "warn",
|
|
206
|
-
"dom/no-missing-iframe-sandbox": "warn",
|
|
207
|
-
"dom/no-namespace": "error",
|
|
208
|
-
"dom/no-script-url": "warn",
|
|
209
|
-
"dom/no-unsafe-iframe-sandbox": "warn",
|
|
210
|
-
"dom/no-unsafe-target-blank": "warn"
|
|
188
|
+
var corePresetSettings = {
|
|
189
|
+
...shared.DEFAULT_ESLINT_REACT_SETTINGS
|
|
211
190
|
};
|
|
212
191
|
var domPresetSettings = {
|
|
213
|
-
...
|
|
192
|
+
...corePresetSettings,
|
|
214
193
|
additionalComponents: [
|
|
215
194
|
{
|
|
216
195
|
name: "Link",
|
|
@@ -264,21 +243,24 @@ var src_default = {
|
|
|
264
243
|
version
|
|
265
244
|
},
|
|
266
245
|
configs: {
|
|
267
|
-
all: createFlatConfig(allPreset),
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
"
|
|
272
|
-
|
|
273
|
-
"
|
|
274
|
-
|
|
275
|
-
"
|
|
276
|
-
"
|
|
277
|
-
"
|
|
278
|
-
"off-dom
|
|
279
|
-
"off-legacy": createLegacyConfig(
|
|
280
|
-
"
|
|
281
|
-
"recommended
|
|
246
|
+
["all"]: createFlatConfig(allPreset),
|
|
247
|
+
["all-legacy"]: createLegacyConfig(allPreset),
|
|
248
|
+
["core"]: createFlatConfig(corePreset, corePresetSettings),
|
|
249
|
+
["core-legacy"]: createLegacyConfig(corePreset, corePresetSettings),
|
|
250
|
+
["debug"]: createFlatConfig(debugPreset),
|
|
251
|
+
["debug-legacy"]: createLegacyConfig(debugPreset),
|
|
252
|
+
["dom"]: createFlatConfig(domPreset, domPresetSettings),
|
|
253
|
+
["dom-legacy"]: createLegacyConfig(domPreset),
|
|
254
|
+
// ["hooks-extra"]: createFlatConfig(hooksExtraPreset),
|
|
255
|
+
// ["hooks-extra-legacy"]: createLegacyConfig(hooksExtraPreset),
|
|
256
|
+
["off"]: createFlatConfig(offPreset),
|
|
257
|
+
["off-dom"]: createFlatConfig(offDomPreset),
|
|
258
|
+
["off-dom-legacy"]: createLegacyConfig(offDomPreset),
|
|
259
|
+
["off-legacy"]: createLegacyConfig(offPreset),
|
|
260
|
+
["recommended"]: createFlatConfig(recommendedPreset),
|
|
261
|
+
["recommended-legacy"]: createLegacyConfig(recommendedPreset),
|
|
262
|
+
["recommended-type-checked"]: createFlatConfig(recommendedTypeCheckedPreset),
|
|
263
|
+
["recommended-type-checked-legacy"]: createLegacyConfig(recommendedTypeCheckedPreset)
|
|
282
264
|
},
|
|
283
265
|
rules: {
|
|
284
266
|
...react__namespace.rules,
|
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { typeOf } from '@eslint-react/tools';
|
|
|
11
11
|
|
|
12
12
|
// package.json
|
|
13
13
|
var name = "@eslint-react/eslint-plugin";
|
|
14
|
-
var version = "1.
|
|
14
|
+
var version = "1.9.0-beta.3";
|
|
15
15
|
function transformKeys(obj, transform) {
|
|
16
16
|
if (typeOf(obj) !== "object") return obj;
|
|
17
17
|
const res = {};
|
|
@@ -50,10 +50,8 @@ var allPreset = {
|
|
|
50
50
|
"no-default-props": "error",
|
|
51
51
|
"no-direct-mutation-state": "error",
|
|
52
52
|
"no-duplicate-key": "error",
|
|
53
|
-
// This rule has been deprecated
|
|
54
53
|
// "no-implicit-key": "error",
|
|
55
|
-
// This rule requires type information
|
|
56
|
-
// "no-leaked-conditional-rendering": "warn",
|
|
54
|
+
// "no-leaked-conditional-rendering": "warn", // This rule requires type information
|
|
57
55
|
"no-missing-component-display-name": "warn",
|
|
58
56
|
"no-missing-key": "error",
|
|
59
57
|
"no-nested-components": "warn",
|
|
@@ -72,8 +70,7 @@ var allPreset = {
|
|
|
72
70
|
"no-unused-state": "warn",
|
|
73
71
|
"no-useless-fragment": "warn",
|
|
74
72
|
"prefer-destructuring-assignment": "warn",
|
|
75
|
-
// This rule requires type information
|
|
76
|
-
// "prefer-read-only-props": "warn",
|
|
73
|
+
// "prefer-read-only-props": "warn", // This rule requires type information
|
|
77
74
|
"prefer-shorthand-boolean": "warn",
|
|
78
75
|
"prefer-shorthand-fragment": "warn",
|
|
79
76
|
// eslint-disable-next-line perfectionist/sort-objects
|
|
@@ -88,19 +85,12 @@ var allPreset = {
|
|
|
88
85
|
"dom/no-script-url": "warn",
|
|
89
86
|
"dom/no-unsafe-iframe-sandbox": "warn",
|
|
90
87
|
"dom/no-unsafe-target-blank": "warn",
|
|
91
|
-
"hooks-extra/ensure-custom-hooks-using-other-hooks": "warn",
|
|
92
|
-
"hooks-extra/ensure-use-callback-has-non-empty-deps": "warn",
|
|
93
|
-
"hooks-extra/ensure-use-memo-has-non-empty-deps": "warn",
|
|
94
|
-
"hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
95
|
-
"hooks-extra/no-direct-set-state-in-use-layout-effect": "warn",
|
|
96
|
-
"hooks-extra/prefer-use-state-lazy-initialization": "warn",
|
|
97
88
|
"naming-convention/component-name": "warn",
|
|
98
89
|
"naming-convention/filename": "warn",
|
|
99
90
|
"naming-convention/filename-extension": "warn",
|
|
100
91
|
"naming-convention/use-state": "warn"
|
|
101
92
|
};
|
|
102
|
-
var
|
|
103
|
-
// Part: react rules
|
|
93
|
+
var corePreset = {
|
|
104
94
|
// "avoid-shorthand-boolean": "warn",
|
|
105
95
|
// "avoid-shorthand-fragment": "warn",
|
|
106
96
|
"ensure-forward-ref-using-ref": "warn",
|
|
@@ -140,13 +130,14 @@ var recommendedPreset = {
|
|
|
140
130
|
"no-unstable-context-value": "error",
|
|
141
131
|
"no-unstable-default-props": "error",
|
|
142
132
|
"no-unused-class-component-members": "warn",
|
|
143
|
-
"no-unused-state": "warn"
|
|
133
|
+
"no-unused-state": "warn"
|
|
144
134
|
// "no-useless-fragment": "warn",
|
|
145
135
|
// "prefer-read-only-props": "warn",
|
|
146
136
|
// "prefer-destructuring-assignment": "warn",
|
|
147
137
|
// "prefer-shorthand-boolean": "warn",
|
|
148
138
|
// "prefer-shorthand-fragment": "warn",
|
|
149
|
-
|
|
139
|
+
};
|
|
140
|
+
var domPreset = {
|
|
150
141
|
"dom/no-children-in-void-dom-elements": "warn",
|
|
151
142
|
"dom/no-dangerously-set-innerhtml": "warn",
|
|
152
143
|
"dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
@@ -157,33 +148,21 @@ var recommendedPreset = {
|
|
|
157
148
|
"dom/no-render-return-value": "error",
|
|
158
149
|
"dom/no-script-url": "warn",
|
|
159
150
|
"dom/no-unsafe-iframe-sandbox": "warn",
|
|
160
|
-
"dom/no-unsafe-target-blank": "warn"
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
// "hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
166
|
-
// "hooks-extra/no-direct-set-state-in-use-layout-effect": "warn",
|
|
167
|
-
"hooks-extra/prefer-use-state-lazy-initialization": "warn"
|
|
151
|
+
"dom/no-unsafe-target-blank": "warn"
|
|
152
|
+
};
|
|
153
|
+
var recommendedPreset = {
|
|
154
|
+
...corePreset,
|
|
155
|
+
...domPreset
|
|
168
156
|
};
|
|
169
157
|
var recommendedTypeCheckedPreset = {
|
|
170
158
|
...recommendedPreset,
|
|
171
159
|
"no-leaked-conditional-rendering": "warn"
|
|
172
160
|
};
|
|
173
|
-
var
|
|
174
|
-
|
|
175
|
-
"dom/no-dangerously-set-innerhtml": "warn",
|
|
176
|
-
"dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
177
|
-
"dom/no-find-dom-node": "error",
|
|
178
|
-
"dom/no-missing-button-type": "warn",
|
|
179
|
-
"dom/no-missing-iframe-sandbox": "warn",
|
|
180
|
-
"dom/no-namespace": "error",
|
|
181
|
-
"dom/no-script-url": "warn",
|
|
182
|
-
"dom/no-unsafe-iframe-sandbox": "warn",
|
|
183
|
-
"dom/no-unsafe-target-blank": "warn"
|
|
161
|
+
var corePresetSettings = {
|
|
162
|
+
...DEFAULT_ESLINT_REACT_SETTINGS
|
|
184
163
|
};
|
|
185
164
|
var domPresetSettings = {
|
|
186
|
-
...
|
|
165
|
+
...corePresetSettings,
|
|
187
166
|
additionalComponents: [
|
|
188
167
|
{
|
|
189
168
|
name: "Link",
|
|
@@ -237,21 +216,24 @@ var src_default = {
|
|
|
237
216
|
version
|
|
238
217
|
},
|
|
239
218
|
configs: {
|
|
240
|
-
all: createFlatConfig(allPreset),
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
"
|
|
245
|
-
|
|
246
|
-
"
|
|
247
|
-
|
|
248
|
-
"
|
|
249
|
-
"
|
|
250
|
-
"
|
|
251
|
-
"off-dom
|
|
252
|
-
"off-legacy": createLegacyConfig(
|
|
253
|
-
"
|
|
254
|
-
"recommended
|
|
219
|
+
["all"]: createFlatConfig(allPreset),
|
|
220
|
+
["all-legacy"]: createLegacyConfig(allPreset),
|
|
221
|
+
["core"]: createFlatConfig(corePreset, corePresetSettings),
|
|
222
|
+
["core-legacy"]: createLegacyConfig(corePreset, corePresetSettings),
|
|
223
|
+
["debug"]: createFlatConfig(debugPreset),
|
|
224
|
+
["debug-legacy"]: createLegacyConfig(debugPreset),
|
|
225
|
+
["dom"]: createFlatConfig(domPreset, domPresetSettings),
|
|
226
|
+
["dom-legacy"]: createLegacyConfig(domPreset),
|
|
227
|
+
// ["hooks-extra"]: createFlatConfig(hooksExtraPreset),
|
|
228
|
+
// ["hooks-extra-legacy"]: createLegacyConfig(hooksExtraPreset),
|
|
229
|
+
["off"]: createFlatConfig(offPreset),
|
|
230
|
+
["off-dom"]: createFlatConfig(offDomPreset),
|
|
231
|
+
["off-dom-legacy"]: createLegacyConfig(offDomPreset),
|
|
232
|
+
["off-legacy"]: createLegacyConfig(offPreset),
|
|
233
|
+
["recommended"]: createFlatConfig(recommendedPreset),
|
|
234
|
+
["recommended-legacy"]: createLegacyConfig(recommendedPreset),
|
|
235
|
+
["recommended-type-checked"]: createFlatConfig(recommendedTypeCheckedPreset),
|
|
236
|
+
["recommended-type-checked-legacy"]: createLegacyConfig(recommendedTypeCheckedPreset)
|
|
255
237
|
},
|
|
256
238
|
rules: {
|
|
257
239
|
...react.rules,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/eslint-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0-beta.3",
|
|
4
4
|
"description": "The main ESLint plugin of ESLint React. Contains all the rules and presets of ESLint React.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -43,22 +43,22 @@
|
|
|
43
43
|
"./package.json"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@typescript-eslint/scope-manager": "^8.0.
|
|
47
|
-
"@typescript-eslint/type-utils": "^8.0.
|
|
48
|
-
"@typescript-eslint/types": "^8.0.
|
|
49
|
-
"@typescript-eslint/utils": "^8.0.
|
|
50
|
-
"remeda": "^2.7.
|
|
51
|
-
"@eslint-react/shared": "1.
|
|
52
|
-
"@eslint-react/types": "1.
|
|
53
|
-
"@eslint-react/tools": "1.
|
|
54
|
-
"eslint-plugin-react-
|
|
55
|
-
"eslint-plugin-react-
|
|
56
|
-
"eslint-plugin-react-
|
|
57
|
-
"eslint-plugin-react-
|
|
58
|
-
"eslint-plugin-react-
|
|
46
|
+
"@typescript-eslint/scope-manager": "^8.0.1",
|
|
47
|
+
"@typescript-eslint/type-utils": "^8.0.1",
|
|
48
|
+
"@typescript-eslint/types": "^8.0.1",
|
|
49
|
+
"@typescript-eslint/utils": "^8.0.1",
|
|
50
|
+
"remeda": "^2.7.1",
|
|
51
|
+
"@eslint-react/shared": "1.9.0-beta.3",
|
|
52
|
+
"@eslint-react/types": "1.9.0-beta.3",
|
|
53
|
+
"@eslint-react/tools": "1.9.0-beta.3",
|
|
54
|
+
"eslint-plugin-react-hooks-extra": "1.9.0-beta.3",
|
|
55
|
+
"eslint-plugin-react-debug": "1.9.0-beta.3",
|
|
56
|
+
"eslint-plugin-react-dom": "1.9.0-beta.3",
|
|
57
|
+
"eslint-plugin-react-naming-convention": "1.9.0-beta.3",
|
|
58
|
+
"eslint-plugin-react-x": "1.9.0-beta.3"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"tsup": "8.2.4"
|
|
61
|
+
"tsup": "^8.2.4"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"eslint": "^8.57.0 || ^9.0.0",
|