@eslint-react/core 5.2.5-next.0 → 5.3.0-next.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/index.js +3 -3
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -309,7 +309,7 @@ function isPureComponent(node) {
|
|
|
309
309
|
return false;
|
|
310
310
|
}
|
|
311
311
|
function createLifecycleChecker(methodName, isStatic = false) {
|
|
312
|
-
return (node) => Check.
|
|
312
|
+
return (node) => Check.isPropertyOrMethod(node) && node.static === isStatic && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === methodName;
|
|
313
313
|
}
|
|
314
314
|
/** @deprecated Class components are legacy. */
|
|
315
315
|
const isRender = createLifecycleChecker("render");
|
|
@@ -352,7 +352,7 @@ const isGetDerivedStateFromError = createLifecycleChecker("getDerivedStateFromEr
|
|
|
352
352
|
* @deprecated Class components are legacy. This function exists only to support legacy rules.
|
|
353
353
|
*/
|
|
354
354
|
function isRenderMethodLike(node) {
|
|
355
|
-
return Check.
|
|
355
|
+
return Check.isPropertyOrMethod(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name.startsWith("render") && isOneOf([AST_NODE_TYPES.ClassDeclaration, AST_NODE_TYPES.ClassExpression])(node.parent.parent);
|
|
356
356
|
}
|
|
357
357
|
function isRenderMethodCallback(node) {
|
|
358
358
|
const parent = node.parent;
|
|
@@ -436,7 +436,7 @@ function getFunctionId(node) {
|
|
|
436
436
|
case node.parent.type === AST_NODE_TYPES.VariableDeclarator && node.parent.init === node: return node.parent.id;
|
|
437
437
|
case node.parent.type === AST_NODE_TYPES.AssignmentExpression && node.parent.right === node && node.parent.operator === "=": return node.parent.left;
|
|
438
438
|
case node.parent.type === AST_NODE_TYPES.Property && node.parent.value === node && !node.parent.computed: return node.parent.key;
|
|
439
|
-
case Check.
|
|
439
|
+
case Check.isPropertyOrMethod(node.parent) && node.parent.value === node: return node.parent.key;
|
|
440
440
|
case node.parent.type === AST_NODE_TYPES.AssignmentPattern && node.parent.right === node: return node.parent.left;
|
|
441
441
|
case node.parent.type === AST_NODE_TYPES.ConditionalExpression: return getFunctionId(node.parent);
|
|
442
442
|
case Check.isTypeAssertionExpression(node.parent): return getFunctionId(node.parent);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0-next.0",
|
|
4
4
|
"description": "ESLint React's ESLint utility module for static analysis of React core APIs and patterns.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"@typescript-eslint/types": "^8.58.2",
|
|
35
35
|
"@typescript-eslint/utils": "^8.58.2",
|
|
36
36
|
"ts-pattern": "^5.9.0",
|
|
37
|
-
"@eslint-react/ast": "5.
|
|
38
|
-
"@eslint-react/eslint": "5.
|
|
39
|
-
"@eslint-react/jsx": "5.
|
|
40
|
-
"@eslint-react/shared": "5.
|
|
41
|
-
"@eslint-react/var": "5.
|
|
37
|
+
"@eslint-react/ast": "5.3.0-next.0",
|
|
38
|
+
"@eslint-react/eslint": "5.3.0-next.0",
|
|
39
|
+
"@eslint-react/jsx": "5.3.0-next.0",
|
|
40
|
+
"@eslint-react/shared": "5.3.0-next.0",
|
|
41
|
+
"@eslint-react/var": "5.3.0-next.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@typescript-eslint/typescript-estree": "^8.58.2",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@local/eff": "3.0.0-beta.72"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"eslint": "^10.2.
|
|
50
|
+
"eslint": "^10.2.1",
|
|
51
51
|
"typescript": "*"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|