eslint-plugin-react-dom 5.18.5 → 5.18.7
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/index.js +13 -13
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region package.json
|
|
27
27
|
var name$2 = "eslint-plugin-react-dom";
|
|
28
|
-
var version = "5.18.
|
|
28
|
+
var version = "5.18.7";
|
|
29
29
|
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/utils/create-rule.ts
|
|
@@ -160,14 +160,14 @@ function create$11(context) {
|
|
|
160
160
|
CallExpression(node) {
|
|
161
161
|
const callee = Extract.unwrap(node.callee);
|
|
162
162
|
switch (true) {
|
|
163
|
-
case callee
|
|
163
|
+
case Check.isIdentifier(callee) && hydrateNames.has(callee.name):
|
|
164
164
|
context.report({
|
|
165
165
|
fix: buildFix$2(context, node),
|
|
166
166
|
messageId: "default",
|
|
167
167
|
node
|
|
168
168
|
});
|
|
169
169
|
return;
|
|
170
|
-
case callee.type === AST_NODE_TYPES.MemberExpression && callee.object
|
|
170
|
+
case callee.type === AST_NODE_TYPES.MemberExpression && Check.isIdentifier(callee.object) && Extract.getCalleeName(node) === "hydrate" && reactDomNames.has(callee.object.name):
|
|
171
171
|
context.report({
|
|
172
172
|
fix: buildFix$2(context, node),
|
|
173
173
|
messageId: "default",
|
|
@@ -181,7 +181,7 @@ function create$11(context) {
|
|
|
181
181
|
if (baseSource !== "react-dom") return;
|
|
182
182
|
for (const specifier of node.specifiers) switch (specifier.type) {
|
|
183
183
|
case AST_NODE_TYPES.ImportSpecifier:
|
|
184
|
-
if (specifier.imported
|
|
184
|
+
if (!Check.isIdentifier(specifier.imported)) continue;
|
|
185
185
|
if (specifier.imported.name === "hydrate") hydrateNames.add(specifier.local.name);
|
|
186
186
|
continue;
|
|
187
187
|
case AST_NODE_TYPES.ImportDefaultSpecifier:
|
|
@@ -368,13 +368,13 @@ function create$8(context) {
|
|
|
368
368
|
CallExpression(node) {
|
|
369
369
|
const callee = Extract.unwrap(node.callee);
|
|
370
370
|
switch (true) {
|
|
371
|
-
case callee
|
|
371
|
+
case Check.isIdentifier(callee) && renderNames.has(callee.name) && isReturnValueUsed(node):
|
|
372
372
|
context.report({
|
|
373
373
|
messageId: "default",
|
|
374
374
|
node
|
|
375
375
|
});
|
|
376
376
|
return;
|
|
377
|
-
case callee.type === AST_NODE_TYPES.MemberExpression && callee.object
|
|
377
|
+
case callee.type === AST_NODE_TYPES.MemberExpression && Check.isIdentifier(callee.object) && Extract.getCalleeName(node) === "render" && reactDomNames.has(callee.object.name) && isReturnValueUsed(node):
|
|
378
378
|
context.report({
|
|
379
379
|
messageId: "default",
|
|
380
380
|
node
|
|
@@ -387,7 +387,7 @@ function create$8(context) {
|
|
|
387
387
|
if (baseSource !== "react-dom") return;
|
|
388
388
|
for (const specifier of node.specifiers) switch (specifier.type) {
|
|
389
389
|
case AST_NODE_TYPES.ImportSpecifier:
|
|
390
|
-
if (specifier.imported
|
|
390
|
+
if (!Check.isIdentifier(specifier.imported)) continue;
|
|
391
391
|
if (specifier.imported.name === "render") renderNames.add(specifier.local.name);
|
|
392
392
|
continue;
|
|
393
393
|
case AST_NODE_TYPES.ImportDefaultSpecifier:
|
|
@@ -424,14 +424,14 @@ function create$7(context) {
|
|
|
424
424
|
CallExpression(node) {
|
|
425
425
|
const callee = Extract.unwrap(node.callee);
|
|
426
426
|
switch (true) {
|
|
427
|
-
case callee
|
|
427
|
+
case Check.isIdentifier(callee) && renderNames.has(callee.name):
|
|
428
428
|
context.report({
|
|
429
429
|
fix: buildFix$1(context, node),
|
|
430
430
|
messageId: "default",
|
|
431
431
|
node
|
|
432
432
|
});
|
|
433
433
|
return;
|
|
434
|
-
case callee.type === AST_NODE_TYPES.MemberExpression && callee.object
|
|
434
|
+
case callee.type === AST_NODE_TYPES.MemberExpression && Check.isIdentifier(callee.object) && Extract.getCalleeName(node) === "render" && reactDomNames.has(callee.object.name):
|
|
435
435
|
context.report({
|
|
436
436
|
fix: buildFix$1(context, node),
|
|
437
437
|
messageId: "default",
|
|
@@ -445,7 +445,7 @@ function create$7(context) {
|
|
|
445
445
|
if (baseSource !== "react-dom") return;
|
|
446
446
|
for (const specifier of node.specifiers) switch (specifier.type) {
|
|
447
447
|
case AST_NODE_TYPES.ImportSpecifier:
|
|
448
|
-
if (specifier.imported
|
|
448
|
+
if (!Check.isIdentifier(specifier.imported)) continue;
|
|
449
449
|
if (specifier.imported.name === "render") renderNames.add(specifier.local.name);
|
|
450
450
|
continue;
|
|
451
451
|
case AST_NODE_TYPES.ImportDefaultSpecifier:
|
|
@@ -1833,14 +1833,14 @@ function create$1(context) {
|
|
|
1833
1833
|
CallExpression(node) {
|
|
1834
1834
|
const callee = Extract.unwrap(node.callee);
|
|
1835
1835
|
switch (true) {
|
|
1836
|
-
case callee
|
|
1836
|
+
case Check.isIdentifier(callee) && useFormStateNames.has(callee.name):
|
|
1837
1837
|
context.report({
|
|
1838
1838
|
fix: buildFix(context, node),
|
|
1839
1839
|
messageId: "default",
|
|
1840
1840
|
node
|
|
1841
1841
|
});
|
|
1842
1842
|
return;
|
|
1843
|
-
case callee.type === AST_NODE_TYPES.MemberExpression && callee.object
|
|
1843
|
+
case callee.type === AST_NODE_TYPES.MemberExpression && Check.isIdentifier(callee.object) && Extract.getCalleeName(node) === "useFormState" && reactDomNames.has(callee.object.name):
|
|
1844
1844
|
context.report({
|
|
1845
1845
|
fix: buildFix(context, node),
|
|
1846
1846
|
messageId: "default",
|
|
@@ -1854,7 +1854,7 @@ function create$1(context) {
|
|
|
1854
1854
|
if (baseSource !== "react-dom") return;
|
|
1855
1855
|
for (const specifier of node.specifiers) switch (specifier.type) {
|
|
1856
1856
|
case AST_NODE_TYPES.ImportSpecifier:
|
|
1857
|
-
if (specifier.imported
|
|
1857
|
+
if (!Check.isIdentifier(specifier.imported)) continue;
|
|
1858
1858
|
if (specifier.imported.name === "useFormState") useFormStateNames.add(specifier.local.name);
|
|
1859
1859
|
continue;
|
|
1860
1860
|
case AST_NODE_TYPES.ImportDefaultSpecifier:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "5.18.
|
|
3
|
+
"version": "5.18.7",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for DOM related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -37,23 +37,23 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"@eslint-react/
|
|
44
|
-
"@eslint
|
|
45
|
-
"@eslint
|
|
46
|
-
"
|
|
40
|
+
"@eslint-react/ast": "5.18.7",
|
|
41
|
+
"@eslint-react/eslint": "5.18.7",
|
|
42
|
+
"@eslint-react/jsx": "5.18.7",
|
|
43
|
+
"@eslint-react/shared": "5.18.7",
|
|
44
|
+
"@typescript-eslint/types": "^8.69.0",
|
|
45
|
+
"@typescript-eslint/utils": "^8.69.0",
|
|
46
|
+
"compare-versions": "^6.1.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
+
"@local/configs": "0.0.0",
|
|
50
|
+
"@local/eff": "0.0.0",
|
|
49
51
|
"@types/react": "^19.2.18",
|
|
50
|
-
"@types/react-dom": "^19.2.
|
|
52
|
+
"@types/react-dom": "^19.2.5",
|
|
51
53
|
"dedent": "^1.7.2",
|
|
52
|
-
"eslint": "^10.
|
|
54
|
+
"eslint": "^10.9.1",
|
|
53
55
|
"tsdown": "^0.22.14",
|
|
54
|
-
"typescript": "6.0.3"
|
|
55
|
-
"@local/configs": "0.0.0",
|
|
56
|
-
"@local/eff": "0.0.0"
|
|
56
|
+
"typescript": "6.0.3"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"eslint": "*",
|