@eslint-react/core 2.4.0-next.1 → 2.4.0-next.10
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 +3 -8
- package/dist/index.js +1 -13
- package/package.json +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -221,14 +221,12 @@ declare function useComponentCollectorLegacy(): useComponentCollectorLegacy.Retu
|
|
|
221
221
|
/**
|
|
222
222
|
* Check whether the given node is a this.setState() call
|
|
223
223
|
* @param node The node to check
|
|
224
|
-
* @param node
|
|
225
224
|
* @internal
|
|
226
225
|
*/
|
|
227
226
|
declare function isThisSetState(node: TSESTree$1.CallExpression): boolean;
|
|
228
227
|
/**
|
|
229
228
|
* Check whether the given node is an assignment to this.state
|
|
230
229
|
* @param node The node to check
|
|
231
|
-
* @param node
|
|
232
230
|
* @internal
|
|
233
231
|
*/
|
|
234
232
|
declare function isAssignmentToThisState(node: TSESTree$1.AssignmentExpression): boolean;
|
|
@@ -240,9 +238,6 @@ declare function isAssignmentToThisState(node: TSESTree$1.AssignmentExpression):
|
|
|
240
238
|
* @param context The rule context
|
|
241
239
|
* @param node The function node to analyze
|
|
242
240
|
* @param hint Component detection hints (bit flags) to customize detection logic
|
|
243
|
-
* @param context
|
|
244
|
-
* @param node
|
|
245
|
-
* @param hint
|
|
246
241
|
* @returns `true` if the node is considered a component definition
|
|
247
242
|
*/
|
|
248
243
|
declare function isComponentDefinition(context: RuleContext, node: AST.TSESTreeFunction, hint: bigint): boolean;
|
|
@@ -577,7 +572,7 @@ declare function resolveJsxAttributeValue(context: RuleContext, attribute: AST.T
|
|
|
577
572
|
readonly toStatic: () => string | number | bigint | boolean | RegExp | null;
|
|
578
573
|
} | {
|
|
579
574
|
readonly kind: "expression";
|
|
580
|
-
readonly node: TSESTree.
|
|
575
|
+
readonly node: TSESTree.Expression | TSESTree.JSXEmptyExpression;
|
|
581
576
|
readonly toStatic: () => unknown;
|
|
582
577
|
} | {
|
|
583
578
|
readonly kind: "element";
|
|
@@ -585,7 +580,7 @@ declare function resolveJsxAttributeValue(context: RuleContext, attribute: AST.T
|
|
|
585
580
|
readonly toStatic: () => undefined;
|
|
586
581
|
} | {
|
|
587
582
|
readonly kind: "spreadChild";
|
|
588
|
-
readonly node: TSESTree.
|
|
583
|
+
readonly node: TSESTree.Expression | TSESTree.JSXEmptyExpression;
|
|
589
584
|
readonly toStatic: () => undefined;
|
|
590
585
|
} | {
|
|
591
586
|
readonly kind: "spreadProps";
|
|
@@ -730,7 +725,7 @@ declare function stringifyJsx(node: TSESTree$1.JSXIdentifier | TSESTree$1.JSXNam
|
|
|
730
725
|
* @param prev The previous AST node in the traversal (used for context)
|
|
731
726
|
* @internal
|
|
732
727
|
*/
|
|
733
|
-
declare function getInstanceId(node: TSESTree.Node, prev?: TSESTree.Node): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.
|
|
728
|
+
declare function getInstanceId(node: TSESTree.Node, prev?: TSESTree.Node): TSESTree.JSXElement | TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | 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.YieldExpression | TSESTree.PrivateIdentifier | undefined;
|
|
734
729
|
//#endregion
|
|
735
730
|
//#region src/utils/is-from-react.d.ts
|
|
736
731
|
/**
|
package/dist/index.js
CHANGED
|
@@ -499,9 +499,7 @@ function isJsxLike(code, node, hint = DEFAULT_JSX_DETECTION_HINT) {
|
|
|
499
499
|
const { name } = node;
|
|
500
500
|
if (name === "undefined") return !(hint & JsxDetectionHint.SkipUndefined);
|
|
501
501
|
if (AST.isJSXTagNameExpression(node)) return true;
|
|
502
|
-
|
|
503
|
-
const variableNode = variable && getVariableDefinitionNode(variable, 0);
|
|
504
|
-
return !!variableNode && isJsxLike(code, variableNode, hint);
|
|
502
|
+
return isJsxLike(code, getVariableDefinitionNode(findVariable(name, code.getScope(node)), 0), hint);
|
|
505
503
|
}
|
|
506
504
|
}
|
|
507
505
|
return false;
|
|
@@ -804,7 +802,6 @@ const FUNCTION_PATTERNS = {
|
|
|
804
802
|
* Checks if the given node is a function within a render method of a class component.
|
|
805
803
|
*
|
|
806
804
|
* @param node The AST node to check
|
|
807
|
-
* @param node
|
|
808
805
|
* @returns `true` if the node is a render function inside a class component
|
|
809
806
|
*
|
|
810
807
|
* @example
|
|
@@ -824,8 +821,6 @@ function isFunctionOfRenderMethod(node) {
|
|
|
824
821
|
*
|
|
825
822
|
* @param node The function node to check
|
|
826
823
|
* @param hint Component detection hints as bit flags
|
|
827
|
-
* @param node
|
|
828
|
-
* @param hint
|
|
829
824
|
* @returns `true` if the function matches an exclusion hint
|
|
830
825
|
*/
|
|
831
826
|
function shouldExcludeBasedOnHint(node, hint) {
|
|
@@ -840,8 +835,6 @@ function shouldExcludeBasedOnHint(node, hint) {
|
|
|
840
835
|
*
|
|
841
836
|
* @param context The rule context
|
|
842
837
|
* @param node The AST node to check
|
|
843
|
-
* @param context
|
|
844
|
-
* @param node
|
|
845
838
|
* @returns `true` if the node is passed as a child to `createElement`
|
|
846
839
|
*/
|
|
847
840
|
function isChildrenOfCreateElement(context, node) {
|
|
@@ -856,9 +849,6 @@ function isChildrenOfCreateElement(context, node) {
|
|
|
856
849
|
* @param context The rule context
|
|
857
850
|
* @param node The function node to analyze
|
|
858
851
|
* @param hint Component detection hints (bit flags) to customize detection logic
|
|
859
|
-
* @param context
|
|
860
|
-
* @param node
|
|
861
|
-
* @param hint
|
|
862
852
|
* @returns `true` if the node is considered a component definition
|
|
863
853
|
*/
|
|
864
854
|
function isComponentDefinition(context, node, hint) {
|
|
@@ -1105,7 +1095,6 @@ function useComponentCollectorLegacy() {
|
|
|
1105
1095
|
/**
|
|
1106
1096
|
* Check whether the given node is a this.setState() call
|
|
1107
1097
|
* @param node The node to check
|
|
1108
|
-
* @param node
|
|
1109
1098
|
* @internal
|
|
1110
1099
|
*/
|
|
1111
1100
|
function isThisSetState(node) {
|
|
@@ -1115,7 +1104,6 @@ function isThisSetState(node) {
|
|
|
1115
1104
|
/**
|
|
1116
1105
|
* Check whether the given node is an assignment to this.state
|
|
1117
1106
|
* @param node The node to check
|
|
1118
|
-
* @param node
|
|
1119
1107
|
* @internal
|
|
1120
1108
|
*/
|
|
1121
1109
|
function isAssignmentToThisState(node) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "2.4.0-next.
|
|
3
|
+
"version": "2.4.0-next.10",
|
|
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": {
|
|
@@ -30,24 +30,24 @@
|
|
|
30
30
|
"./package.json"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
34
|
-
"@typescript-eslint/types": "^8.
|
|
35
|
-
"@typescript-eslint/utils": "^8.
|
|
33
|
+
"@typescript-eslint/scope-manager": "^8.50.0",
|
|
34
|
+
"@typescript-eslint/types": "^8.50.0",
|
|
35
|
+
"@typescript-eslint/utils": "^8.50.0",
|
|
36
36
|
"birecord": "^0.1.1",
|
|
37
37
|
"ts-pattern": "^5.9.0",
|
|
38
|
-
"@eslint-react/ast": "2.4.0-next.
|
|
39
|
-
"@eslint-react/
|
|
40
|
-
"@eslint-react/
|
|
41
|
-
"@eslint-react/shared": "2.4.0-next.
|
|
38
|
+
"@eslint-react/ast": "2.4.0-next.10",
|
|
39
|
+
"@eslint-react/var": "2.4.0-next.10",
|
|
40
|
+
"@eslint-react/eff": "2.4.0-next.10",
|
|
41
|
+
"@eslint-react/shared": "2.4.0-next.10"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"tsdown": "^0.18.1",
|
|
45
|
+
"@local/configs": "0.0.0"
|
|
42
46
|
},
|
|
43
47
|
"peerDependencies": {
|
|
44
48
|
"eslint": "^8.57.0 || ^9.0.0",
|
|
45
49
|
"typescript": ">=4.8.4 <6.0.0"
|
|
46
50
|
},
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"tsdown": "^0.17.2",
|
|
49
|
-
"@local/configs": "0.0.0"
|
|
50
|
-
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=20.19.0"
|
|
53
53
|
},
|