@eslint-react/core 5.18.4 → 5.18.5
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.d.ts +1 -1
- package/dist/index.js +3 -12
- package/package.json +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -373,7 +373,7 @@ type FunctionSemanticNode = ClientFunctionSemanticNode | ServerFunctionSemanticN
|
|
|
373
373
|
* @param node The function node to analyze.
|
|
374
374
|
* @returns The identifier node if found, `null` otherwise.
|
|
375
375
|
*/
|
|
376
|
-
declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpressionWithBlockBody | TSESTree.ArrowFunctionExpressionWithExpressionBody | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.
|
|
376
|
+
declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpressionWithBlockBody | TSESTree.ArrowFunctionExpressionWithExpressionBody | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.TemplateLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion | TSESTree.UnaryExpressionBitwiseNot | TSESTree.UnaryExpressionDelete | TSESTree.UnaryExpressionMinus | TSESTree.UnaryExpressionNot | TSESTree.UnaryExpressionPlus | TSESTree.UnaryExpressionTypeof | TSESTree.UnaryExpressionVoid | TSESTree.UpdateExpression | TSESTree.YieldNoStarExpression | TSESTree.YieldStarExpression | TSESTree.PrivateIdentifier | null;
|
|
377
377
|
/**
|
|
378
378
|
* Get the initialization path of a function node in the AST.
|
|
379
379
|
*
|
package/dist/index.js
CHANGED
|
@@ -1187,20 +1187,11 @@ const DEFAULT_COMPONENT_DETECTION_HINT = 0n | FunctionComponentDetectionHint.DoN
|
|
|
1187
1187
|
*/
|
|
1188
1188
|
function isFunctionComponentDefinition(context, node, hint) {
|
|
1189
1189
|
if (!isFunctionWithLooseComponentName(context, node, true)) return false;
|
|
1190
|
-
const isCreateElementArg = (() => {
|
|
1191
|
-
let p = node.parent;
|
|
1192
|
-
while (Check.isTypeExpression(p)) p = p.parent;
|
|
1193
|
-
if (p.type !== AST_NODE_TYPES.CallExpression || !isCreateElementCall(context, p)) return false;
|
|
1194
|
-
return p.arguments.slice(2).some((arg) => Extract.unwrap(arg) === node);
|
|
1195
|
-
})();
|
|
1196
|
-
switch (true) {
|
|
1197
|
-
case isCreateElementArg: return false;
|
|
1198
|
-
case isRenderMethodCallback(node): return false;
|
|
1199
|
-
}
|
|
1200
1190
|
let parent = node.parent;
|
|
1201
1191
|
while (Check.isTypeExpression(parent)) parent = parent.parent;
|
|
1202
|
-
|
|
1203
|
-
|
|
1192
|
+
if (isRenderMethodCallback(node)) return false;
|
|
1193
|
+
if (parent.type === AST_NODE_TYPES.CallExpression && isCreateElementCall(context, parent) && parent.arguments.slice(2).some((arg) => Extract.unwrap(arg) === node)) return false;
|
|
1194
|
+
const [parentCallee, parentCalleeName] = parent.type === AST_NODE_TYPES.CallExpression ? [Extract.unwrap(parent.callee), Extract.getCalleeName(parent)] : [null, null];
|
|
1204
1195
|
switch (true) {
|
|
1205
1196
|
case Check.isOneOf([AST_NODE_TYPES.ArrowFunctionExpression, AST_NODE_TYPES.FunctionExpression])(node) && parent.type === AST_NODE_TYPES.Property && parent.parent.type === AST_NODE_TYPES.ObjectExpression:
|
|
1206
1197
|
if (hint & FunctionComponentDetectionHint.DoNotIncludeFunctionDefinedAsObjectMethod) return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "5.18.
|
|
3
|
+
"version": "5.18.5",
|
|
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": {
|
|
@@ -29,25 +29,25 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
33
|
-
"@typescript-eslint/types": "^8.
|
|
34
|
-
"@typescript-eslint/utils": "^8.
|
|
32
|
+
"@typescript-eslint/scope-manager": "^8.67.0",
|
|
33
|
+
"@typescript-eslint/types": "^8.67.0",
|
|
34
|
+
"@typescript-eslint/utils": "^8.67.0",
|
|
35
35
|
"ts-pattern": "^5.9.0",
|
|
36
|
-
"@eslint-react/ast": "5.18.
|
|
37
|
-
"@eslint-react/eslint": "5.18.
|
|
38
|
-
"@eslint-react/shared": "5.18.
|
|
39
|
-
"@eslint-react/var": "5.18.
|
|
36
|
+
"@eslint-react/ast": "5.18.5",
|
|
37
|
+
"@eslint-react/eslint": "5.18.5",
|
|
38
|
+
"@eslint-react/shared": "5.18.5",
|
|
39
|
+
"@eslint-react/var": "5.18.5"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@typescript-eslint/parser": "^8.
|
|
43
|
-
"@typescript-eslint/typescript-estree": "^8.
|
|
42
|
+
"@typescript-eslint/parser": "^8.67.0",
|
|
43
|
+
"@typescript-eslint/typescript-estree": "^8.67.0",
|
|
44
44
|
"eslint": "^10.8.1",
|
|
45
45
|
"tsdown": "^0.22.14",
|
|
46
46
|
"typescript": "6.0.3",
|
|
47
47
|
"vitest": "^4.1.10",
|
|
48
48
|
"@local/configs": "0.0.0",
|
|
49
|
-
"@local/
|
|
50
|
-
"@local/
|
|
49
|
+
"@local/eff": "0.0.0",
|
|
50
|
+
"@local/testkit": "0.0.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"eslint": "*",
|