@eslint-react/ast 1.46.1-next.0 → 1.47.0-beta.2
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.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -11
- package/dist/index.mjs +10 -11
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -215,8 +215,8 @@ declare const isArrayTupleType: (node: TSESTree$1.Node | null | undefined) => no
|
|
|
215
215
|
declare const isProperty: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.PropertyDefinitionComputedName | TSESTree$1.PropertyDefinitionNonComputedName | TSESTree$1.TSIndexSignature | TSESTree$1.TSParameterProperty | TSESTree$1.TSPropertySignatureComputedName | TSESTree$1.TSPropertySignatureNonComputedName;
|
|
216
216
|
declare const isJSXElement: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.JSXElement;
|
|
217
217
|
declare const isJSXFragment: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.JSXFragment;
|
|
218
|
-
declare const isJSX: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.JSXAttribute | TSESTree$1.JSXClosingElement | TSESTree$1.JSXClosingFragment | TSESTree$1.JSXElement | TSESTree$1.JSXEmptyExpression | TSESTree$1.JSXExpressionContainer | TSESTree$1.JSXFragment | TSESTree$1.JSXIdentifier | TSESTree$1.JSXMemberExpression | TSESTree$1.JSXNamespacedName | TSESTree$1.JSXOpeningElement | TSESTree$1.JSXOpeningFragment | TSESTree$1.JSXSpreadAttribute | TSESTree$1.JSXSpreadChild | TSESTree$1.JSXText;
|
|
219
218
|
declare const isJSXTagNameExpression: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.JSXIdentifier | TSESTree$1.JSXMemberExpression | TSESTree$1.JSXNamespacedName;
|
|
219
|
+
declare const isJSX: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.JSXAttribute | TSESTree$1.JSXClosingElement | TSESTree$1.JSXClosingFragment | TSESTree$1.JSXElement | TSESTree$1.JSXEmptyExpression | TSESTree$1.JSXExpressionContainer | TSESTree$1.JSXFragment | TSESTree$1.JSXIdentifier | TSESTree$1.JSXMemberExpression | TSESTree$1.JSXNamespacedName | TSESTree$1.JSXOpeningElement | TSESTree$1.JSXOpeningFragment | TSESTree$1.JSXSpreadAttribute | TSESTree$1.JSXSpreadChild | TSESTree$1.JSXText;
|
|
220
220
|
declare const isDestructuringPattern: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.ArrayPattern | TSESTree$1.AssignmentPattern | TSESTree$1.ObjectPattern | TSESTree$1.RestElement;
|
|
221
221
|
declare const isTypeDeclaration: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.TSInterfaceDeclaration | TSESTree$1.TSTypeAliasDeclaration;
|
|
222
222
|
declare const isLeftHandSideExpression: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.ArrayExpression | TSESTree$1.ArrayPattern | TSESTree$1.ArrowFunctionExpression | TSESTree$1.CallExpression | TSESTree$1.ClassExpression | TSESTree$1.FunctionExpression | TSESTree$1.Identifier | TSESTree$1.JSXElement | TSESTree$1.JSXFragment | TSESTree$1.BigIntLiteral | TSESTree$1.BooleanLiteral | TSESTree$1.NullLiteral | TSESTree$1.NumberLiteral | TSESTree$1.RegExpLiteral | TSESTree$1.StringLiteral | TSESTree$1.MemberExpressionComputedName | TSESTree$1.MemberExpressionNonComputedName | TSESTree$1.MetaProperty | TSESTree$1.ObjectExpression | TSESTree$1.ObjectPattern | TSESTree$1.SequenceExpression | TSESTree$1.Super | TSESTree$1.TaggedTemplateExpression | TSESTree$1.TemplateLiteral | TSESTree$1.ThisExpression;
|
|
@@ -287,7 +287,7 @@ declare function isThisExpression(node: TSESTree.Expression): boolean;
|
|
|
287
287
|
* @param getText A function that returns the text of the node in the source code
|
|
288
288
|
* @returns Human readable node name
|
|
289
289
|
*/
|
|
290
|
-
declare function
|
|
290
|
+
declare function stringify(node: TSESTree.Node, getText: (node: TSESTree.Node) => string): string;
|
|
291
291
|
|
|
292
292
|
/**
|
|
293
293
|
* Returns human readable node type for given AST node
|
|
@@ -297,4 +297,4 @@ declare function toReadableNodeName(node: TSESTree.Node, getText: (node: TSESTre
|
|
|
297
297
|
declare function toReadableNodeType(node: TSESTree.Node): "property" | "RegExp literal" | "string literal" | "number literal" | "bigint literal" | "boolean literal" | "symbol literal" | "undefined literal" | "object literal" | "function literal" | "null literal" | "identifier" | "member expression" | "JSX attribute" | "JSX element" | "JSX fragment" | "JSX identifier" | "JSX text" | "JSX closing element" | "JSX closing fragment" | "JSX empty expression" | "JSX expression container" | "JSX member expression" | "JSX namespaced name" | "JSX opening element" | "JSX opening fragment" | "JSX spread attribute" | "JSX spread child" | "decorator" | "program" | "super" | "accessor property" | "array expression" | "array pattern" | "function expression" | "arrow function expression" | "assignment expression" | "assignment pattern" | "await expression" | "binary expression" | "block statement" | "break statement" | "call expression" | "catch clause" | "chain expression" | "class body" | "class declaration" | "class expression" | "conditional expression" | "continue statement" | "debugger statement" | "while statement" | "do while statement" | "empty statement" | "export all declaration" | "export default declaration" | "export named declaration" | "export specifier" | "expression statement" | "for in statement" | "for of statement" | "for statement" | "function declaration" | "if statement" | "import attribute" | "import declaration" | "import default specifier" | "import expression" | "import namespace specifier" | "import specifier" | "labeled statement" | "logical expression" | "meta property" | "method definition" | "new expression" | "object expression" | "object pattern" | "private identifier" | "property definition" | "rest element" | "return statement" | "sequence expression" | "spread element" | "static block" | "switch case" | "switch statement" | "tagged template expression" | "template element" | "template literal" | "this expression" | "throw statement" | "try statement" | "unary expression" | "update expression" | "variable declaration" | "variable declarator" | "with statement" | "yield expression" | "ts abstract accessor property" | "ts abstract keyword" | "ts abstract method definition" | "ts abstract property definition" | "ts any keyword" | "ts array type" | "ts as expression" | "ts async keyword" | "ts big int keyword" | "ts boolean keyword" | "ts call signature declaration" | "ts class implements" | "ts conditional type" | "ts constructor type" | "ts construct signature declaration" | "ts declare function" | "ts declare keyword" | "ts empty body function expression" | "ts enum body" | "ts enum declaration" | "ts enum member" | "ts export assignment" | "ts export keyword" | "ts external module reference" | "ts function type" | "ts import equals declaration" | "ts import type" | "ts indexed access type" | "ts index signature" | "ts infer type" | "ts instantiation expression" | "ts interface body" | "ts interface declaration" | "ts interface heritage" | "ts intersection type" | "ts intrinsic keyword" | "ts literal type" | "ts mapped type" | "ts method signature" | "ts module block" | "ts module declaration" | "ts named tuple member" | "ts namespace export declaration" | "ts never keyword" | "ts non null expression" | "ts null keyword" | "ts number keyword" | "ts object keyword" | "ts optional type" | "ts parameter property" | "ts private keyword" | "ts property signature" | "ts protected keyword" | "ts public keyword" | "ts qualified name" | "ts readonly keyword" | "ts rest type" | "ts satisfies expression" | "ts static keyword" | "ts string keyword" | "ts symbol keyword" | "ts template literal type" | "ts this type" | "ts tuple type" | "ts type alias declaration" | "ts type annotation" | "ts type assertion" | "ts type literal" | "ts type operator" | "ts type parameter" | "ts type parameter declaration" | "ts type parameter instantiation" | "ts type predicate" | "ts type query" | "ts type reference" | "ts undefined keyword" | "ts union type" | "ts unknown keyword" | "ts void keyword";
|
|
298
298
|
type ReadableNodeType = ReturnType<typeof toReadableNodeType>;
|
|
299
299
|
|
|
300
|
-
export { type FunctionInitPath, type ReadableNodeType, type TSESTreeArrayTupleType, type TSESTreeClass, type TSESTreeDestructuringPattern, type TSESTreeFunction, type TSESTreeFunctionType, type TSESTreeJSX, type TSESTreeLoop, type TSESTreeMethodOrProperty, type TSESTreeProperty, type TSESTreeTypeAssertionExpression, type TSESTreeTypeDeclaration, type TSESTreeTypeExpression, findParentNode, getArrayMethodCallbackIndexParamPosition, getClassIdentifier, getEcmaExpression, getFunctionIdentifier, getFunctionInitPath, getLiteralValueType, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall, isArrayTupleType, isClass, isConditional, isControlFlow, isDestructuringPattern, isEmptyFunction, isFunction, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLeftHandSideExpression, isLeftHandSideExpressionType, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpression, isTypeAssertionExpression, isTypeDeclaration, isTypeExpression,
|
|
300
|
+
export { type FunctionInitPath, type ReadableNodeType, type TSESTreeArrayTupleType, type TSESTreeClass, type TSESTreeDestructuringPattern, type TSESTreeFunction, type TSESTreeFunctionType, type TSESTreeJSX, type TSESTreeLoop, type TSESTreeMethodOrProperty, type TSESTreeProperty, type TSESTreeTypeAssertionExpression, type TSESTreeTypeDeclaration, type TSESTreeTypeExpression, findParentNode, getArrayMethodCallbackIndexParamPosition, getClassIdentifier, getEcmaExpression, getFunctionIdentifier, getFunctionInitPath, getLiteralValueType, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall, isArrayTupleType, isClass, isConditional, isControlFlow, isDestructuringPattern, isEmptyFunction, isFunction, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLeftHandSideExpression, isLeftHandSideExpressionType, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpression, isTypeAssertionExpression, isTypeDeclaration, isTypeExpression, stringify, toReadableNodeType };
|
package/dist/index.d.ts
CHANGED
|
@@ -215,8 +215,8 @@ declare const isArrayTupleType: (node: TSESTree$1.Node | null | undefined) => no
|
|
|
215
215
|
declare const isProperty: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.PropertyDefinitionComputedName | TSESTree$1.PropertyDefinitionNonComputedName | TSESTree$1.TSIndexSignature | TSESTree$1.TSParameterProperty | TSESTree$1.TSPropertySignatureComputedName | TSESTree$1.TSPropertySignatureNonComputedName;
|
|
216
216
|
declare const isJSXElement: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.JSXElement;
|
|
217
217
|
declare const isJSXFragment: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.JSXFragment;
|
|
218
|
-
declare const isJSX: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.JSXAttribute | TSESTree$1.JSXClosingElement | TSESTree$1.JSXClosingFragment | TSESTree$1.JSXElement | TSESTree$1.JSXEmptyExpression | TSESTree$1.JSXExpressionContainer | TSESTree$1.JSXFragment | TSESTree$1.JSXIdentifier | TSESTree$1.JSXMemberExpression | TSESTree$1.JSXNamespacedName | TSESTree$1.JSXOpeningElement | TSESTree$1.JSXOpeningFragment | TSESTree$1.JSXSpreadAttribute | TSESTree$1.JSXSpreadChild | TSESTree$1.JSXText;
|
|
219
218
|
declare const isJSXTagNameExpression: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.JSXIdentifier | TSESTree$1.JSXMemberExpression | TSESTree$1.JSXNamespacedName;
|
|
219
|
+
declare const isJSX: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.JSXAttribute | TSESTree$1.JSXClosingElement | TSESTree$1.JSXClosingFragment | TSESTree$1.JSXElement | TSESTree$1.JSXEmptyExpression | TSESTree$1.JSXExpressionContainer | TSESTree$1.JSXFragment | TSESTree$1.JSXIdentifier | TSESTree$1.JSXMemberExpression | TSESTree$1.JSXNamespacedName | TSESTree$1.JSXOpeningElement | TSESTree$1.JSXOpeningFragment | TSESTree$1.JSXSpreadAttribute | TSESTree$1.JSXSpreadChild | TSESTree$1.JSXText;
|
|
220
220
|
declare const isDestructuringPattern: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.ArrayPattern | TSESTree$1.AssignmentPattern | TSESTree$1.ObjectPattern | TSESTree$1.RestElement;
|
|
221
221
|
declare const isTypeDeclaration: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.TSInterfaceDeclaration | TSESTree$1.TSTypeAliasDeclaration;
|
|
222
222
|
declare const isLeftHandSideExpression: (node: TSESTree$1.Node | null | undefined) => node is TSESTree$1.ArrayExpression | TSESTree$1.ArrayPattern | TSESTree$1.ArrowFunctionExpression | TSESTree$1.CallExpression | TSESTree$1.ClassExpression | TSESTree$1.FunctionExpression | TSESTree$1.Identifier | TSESTree$1.JSXElement | TSESTree$1.JSXFragment | TSESTree$1.BigIntLiteral | TSESTree$1.BooleanLiteral | TSESTree$1.NullLiteral | TSESTree$1.NumberLiteral | TSESTree$1.RegExpLiteral | TSESTree$1.StringLiteral | TSESTree$1.MemberExpressionComputedName | TSESTree$1.MemberExpressionNonComputedName | TSESTree$1.MetaProperty | TSESTree$1.ObjectExpression | TSESTree$1.ObjectPattern | TSESTree$1.SequenceExpression | TSESTree$1.Super | TSESTree$1.TaggedTemplateExpression | TSESTree$1.TemplateLiteral | TSESTree$1.ThisExpression;
|
|
@@ -287,7 +287,7 @@ declare function isThisExpression(node: TSESTree.Expression): boolean;
|
|
|
287
287
|
* @param getText A function that returns the text of the node in the source code
|
|
288
288
|
* @returns Human readable node name
|
|
289
289
|
*/
|
|
290
|
-
declare function
|
|
290
|
+
declare function stringify(node: TSESTree.Node, getText: (node: TSESTree.Node) => string): string;
|
|
291
291
|
|
|
292
292
|
/**
|
|
293
293
|
* Returns human readable node type for given AST node
|
|
@@ -297,4 +297,4 @@ declare function toReadableNodeName(node: TSESTree.Node, getText: (node: TSESTre
|
|
|
297
297
|
declare function toReadableNodeType(node: TSESTree.Node): "property" | "RegExp literal" | "string literal" | "number literal" | "bigint literal" | "boolean literal" | "symbol literal" | "undefined literal" | "object literal" | "function literal" | "null literal" | "identifier" | "member expression" | "JSX attribute" | "JSX element" | "JSX fragment" | "JSX identifier" | "JSX text" | "JSX closing element" | "JSX closing fragment" | "JSX empty expression" | "JSX expression container" | "JSX member expression" | "JSX namespaced name" | "JSX opening element" | "JSX opening fragment" | "JSX spread attribute" | "JSX spread child" | "decorator" | "program" | "super" | "accessor property" | "array expression" | "array pattern" | "function expression" | "arrow function expression" | "assignment expression" | "assignment pattern" | "await expression" | "binary expression" | "block statement" | "break statement" | "call expression" | "catch clause" | "chain expression" | "class body" | "class declaration" | "class expression" | "conditional expression" | "continue statement" | "debugger statement" | "while statement" | "do while statement" | "empty statement" | "export all declaration" | "export default declaration" | "export named declaration" | "export specifier" | "expression statement" | "for in statement" | "for of statement" | "for statement" | "function declaration" | "if statement" | "import attribute" | "import declaration" | "import default specifier" | "import expression" | "import namespace specifier" | "import specifier" | "labeled statement" | "logical expression" | "meta property" | "method definition" | "new expression" | "object expression" | "object pattern" | "private identifier" | "property definition" | "rest element" | "return statement" | "sequence expression" | "spread element" | "static block" | "switch case" | "switch statement" | "tagged template expression" | "template element" | "template literal" | "this expression" | "throw statement" | "try statement" | "unary expression" | "update expression" | "variable declaration" | "variable declarator" | "with statement" | "yield expression" | "ts abstract accessor property" | "ts abstract keyword" | "ts abstract method definition" | "ts abstract property definition" | "ts any keyword" | "ts array type" | "ts as expression" | "ts async keyword" | "ts big int keyword" | "ts boolean keyword" | "ts call signature declaration" | "ts class implements" | "ts conditional type" | "ts constructor type" | "ts construct signature declaration" | "ts declare function" | "ts declare keyword" | "ts empty body function expression" | "ts enum body" | "ts enum declaration" | "ts enum member" | "ts export assignment" | "ts export keyword" | "ts external module reference" | "ts function type" | "ts import equals declaration" | "ts import type" | "ts indexed access type" | "ts index signature" | "ts infer type" | "ts instantiation expression" | "ts interface body" | "ts interface declaration" | "ts interface heritage" | "ts intersection type" | "ts intrinsic keyword" | "ts literal type" | "ts mapped type" | "ts method signature" | "ts module block" | "ts module declaration" | "ts named tuple member" | "ts namespace export declaration" | "ts never keyword" | "ts non null expression" | "ts null keyword" | "ts number keyword" | "ts object keyword" | "ts optional type" | "ts parameter property" | "ts private keyword" | "ts property signature" | "ts protected keyword" | "ts public keyword" | "ts qualified name" | "ts readonly keyword" | "ts rest type" | "ts satisfies expression" | "ts static keyword" | "ts string keyword" | "ts symbol keyword" | "ts template literal type" | "ts this type" | "ts tuple type" | "ts type alias declaration" | "ts type annotation" | "ts type assertion" | "ts type literal" | "ts type operator" | "ts type parameter" | "ts type parameter declaration" | "ts type parameter instantiation" | "ts type predicate" | "ts type query" | "ts type reference" | "ts undefined keyword" | "ts union type" | "ts unknown keyword" | "ts void keyword";
|
|
298
298
|
type ReadableNodeType = ReturnType<typeof toReadableNodeType>;
|
|
299
299
|
|
|
300
|
-
export { type FunctionInitPath, type ReadableNodeType, type TSESTreeArrayTupleType, type TSESTreeClass, type TSESTreeDestructuringPattern, type TSESTreeFunction, type TSESTreeFunctionType, type TSESTreeJSX, type TSESTreeLoop, type TSESTreeMethodOrProperty, type TSESTreeProperty, type TSESTreeTypeAssertionExpression, type TSESTreeTypeDeclaration, type TSESTreeTypeExpression, findParentNode, getArrayMethodCallbackIndexParamPosition, getClassIdentifier, getEcmaExpression, getFunctionIdentifier, getFunctionInitPath, getLiteralValueType, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall, isArrayTupleType, isClass, isConditional, isControlFlow, isDestructuringPattern, isEmptyFunction, isFunction, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLeftHandSideExpression, isLeftHandSideExpressionType, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpression, isTypeAssertionExpression, isTypeDeclaration, isTypeExpression,
|
|
300
|
+
export { type FunctionInitPath, type ReadableNodeType, type TSESTreeArrayTupleType, type TSESTreeClass, type TSESTreeDestructuringPattern, type TSESTreeFunction, type TSESTreeFunctionType, type TSESTreeJSX, type TSESTreeLoop, type TSESTreeMethodOrProperty, type TSESTreeProperty, type TSESTreeTypeAssertionExpression, type TSESTreeTypeDeclaration, type TSESTreeTypeExpression, findParentNode, getArrayMethodCallbackIndexParamPosition, getClassIdentifier, getEcmaExpression, getFunctionIdentifier, getFunctionInitPath, getLiteralValueType, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall, isArrayTupleType, isClass, isConditional, isControlFlow, isDestructuringPattern, isEmptyFunction, isFunction, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLeftHandSideExpression, isLeftHandSideExpressionType, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpression, isTypeAssertionExpression, isTypeDeclaration, isTypeExpression, stringify, toReadableNodeType };
|
package/dist/index.js
CHANGED
|
@@ -133,9 +133,13 @@ var isProperty = isOneOf([
|
|
|
133
133
|
]);
|
|
134
134
|
var isJSXElement = is(types.AST_NODE_TYPES.JSXElement);
|
|
135
135
|
var isJSXFragment = is(types.AST_NODE_TYPES.JSXFragment);
|
|
136
|
+
var isJSXTagNameExpression = isOneOf([
|
|
137
|
+
types.AST_NODE_TYPES.JSXIdentifier,
|
|
138
|
+
types.AST_NODE_TYPES.JSXMemberExpression,
|
|
139
|
+
types.AST_NODE_TYPES.JSXNamespacedName
|
|
140
|
+
]);
|
|
136
141
|
var isJSX = isOneOf([
|
|
137
142
|
types.AST_NODE_TYPES.JSXAttribute,
|
|
138
|
-
types.AST_NODE_TYPES.JSXSpreadChild,
|
|
139
143
|
types.AST_NODE_TYPES.JSXClosingElement,
|
|
140
144
|
types.AST_NODE_TYPES.JSXClosingFragment,
|
|
141
145
|
types.AST_NODE_TYPES.JSXElement,
|
|
@@ -151,11 +155,6 @@ var isJSX = isOneOf([
|
|
|
151
155
|
types.AST_NODE_TYPES.JSXSpreadChild,
|
|
152
156
|
types.AST_NODE_TYPES.JSXText
|
|
153
157
|
]);
|
|
154
|
-
var isJSXTagNameExpression = isOneOf([
|
|
155
|
-
types.AST_NODE_TYPES.JSXIdentifier,
|
|
156
|
-
types.AST_NODE_TYPES.JSXMemberExpression,
|
|
157
|
-
types.AST_NODE_TYPES.JSXNamespacedName
|
|
158
|
-
]);
|
|
159
158
|
var isDestructuringPattern = isOneOf([
|
|
160
159
|
types.AST_NODE_TYPES.ArrayPattern,
|
|
161
160
|
types.AST_NODE_TYPES.AssignmentPattern,
|
|
@@ -563,17 +562,17 @@ function isProcessEnvNodeEnvCompare(node, operator, value) {
|
|
|
563
562
|
function isThisExpression(node) {
|
|
564
563
|
return getEcmaExpression(node).type === types.AST_NODE_TYPES.ThisExpression;
|
|
565
564
|
}
|
|
566
|
-
function
|
|
565
|
+
function stringify(node, getText) {
|
|
567
566
|
switch (node.type) {
|
|
568
567
|
case types.AST_NODE_TYPES.CallExpression:
|
|
569
|
-
return
|
|
568
|
+
return stringify(node.callee, getText);
|
|
570
569
|
case types.AST_NODE_TYPES.Identifier:
|
|
571
570
|
case types.AST_NODE_TYPES.PrivateIdentifier:
|
|
572
571
|
return node.name;
|
|
573
572
|
case types.AST_NODE_TYPES.JSXIdentifier:
|
|
574
573
|
return `<${node.name}>`;
|
|
575
574
|
case types.AST_NODE_TYPES.JSXMemberExpression:
|
|
576
|
-
return `${
|
|
575
|
+
return `${stringify(node.object, getText)}.${stringify(node.property, getText)}`;
|
|
577
576
|
case types.AST_NODE_TYPES.JSXNamespacedName:
|
|
578
577
|
return `${node.namespace.name}:${node.name.name}`;
|
|
579
578
|
case types.AST_NODE_TYPES.JSXText:
|
|
@@ -581,7 +580,7 @@ function toReadableNodeName(node, getText) {
|
|
|
581
580
|
case types.AST_NODE_TYPES.Literal:
|
|
582
581
|
return node.raw;
|
|
583
582
|
case types.AST_NODE_TYPES.MemberExpression:
|
|
584
|
-
return `${
|
|
583
|
+
return `${stringify(node.object, getText)}.${stringify(node.property, getText)}`;
|
|
585
584
|
default:
|
|
586
585
|
return getText(node);
|
|
587
586
|
}
|
|
@@ -644,5 +643,5 @@ exports.isThisExpression = isThisExpression;
|
|
|
644
643
|
exports.isTypeAssertionExpression = isTypeAssertionExpression;
|
|
645
644
|
exports.isTypeDeclaration = isTypeDeclaration;
|
|
646
645
|
exports.isTypeExpression = isTypeExpression;
|
|
647
|
-
exports.
|
|
646
|
+
exports.stringify = stringify;
|
|
648
647
|
exports.toReadableNodeType = toReadableNodeType;
|
package/dist/index.mjs
CHANGED
|
@@ -131,9 +131,13 @@ var isProperty = isOneOf([
|
|
|
131
131
|
]);
|
|
132
132
|
var isJSXElement = is(AST_NODE_TYPES.JSXElement);
|
|
133
133
|
var isJSXFragment = is(AST_NODE_TYPES.JSXFragment);
|
|
134
|
+
var isJSXTagNameExpression = isOneOf([
|
|
135
|
+
AST_NODE_TYPES.JSXIdentifier,
|
|
136
|
+
AST_NODE_TYPES.JSXMemberExpression,
|
|
137
|
+
AST_NODE_TYPES.JSXNamespacedName
|
|
138
|
+
]);
|
|
134
139
|
var isJSX = isOneOf([
|
|
135
140
|
AST_NODE_TYPES.JSXAttribute,
|
|
136
|
-
AST_NODE_TYPES.JSXSpreadChild,
|
|
137
141
|
AST_NODE_TYPES.JSXClosingElement,
|
|
138
142
|
AST_NODE_TYPES.JSXClosingFragment,
|
|
139
143
|
AST_NODE_TYPES.JSXElement,
|
|
@@ -149,11 +153,6 @@ var isJSX = isOneOf([
|
|
|
149
153
|
AST_NODE_TYPES.JSXSpreadChild,
|
|
150
154
|
AST_NODE_TYPES.JSXText
|
|
151
155
|
]);
|
|
152
|
-
var isJSXTagNameExpression = isOneOf([
|
|
153
|
-
AST_NODE_TYPES.JSXIdentifier,
|
|
154
|
-
AST_NODE_TYPES.JSXMemberExpression,
|
|
155
|
-
AST_NODE_TYPES.JSXNamespacedName
|
|
156
|
-
]);
|
|
157
156
|
var isDestructuringPattern = isOneOf([
|
|
158
157
|
AST_NODE_TYPES.ArrayPattern,
|
|
159
158
|
AST_NODE_TYPES.AssignmentPattern,
|
|
@@ -561,17 +560,17 @@ function isProcessEnvNodeEnvCompare(node, operator, value) {
|
|
|
561
560
|
function isThisExpression(node) {
|
|
562
561
|
return getEcmaExpression(node).type === AST_NODE_TYPES.ThisExpression;
|
|
563
562
|
}
|
|
564
|
-
function
|
|
563
|
+
function stringify(node, getText) {
|
|
565
564
|
switch (node.type) {
|
|
566
565
|
case AST_NODE_TYPES.CallExpression:
|
|
567
|
-
return
|
|
566
|
+
return stringify(node.callee, getText);
|
|
568
567
|
case AST_NODE_TYPES.Identifier:
|
|
569
568
|
case AST_NODE_TYPES.PrivateIdentifier:
|
|
570
569
|
return node.name;
|
|
571
570
|
case AST_NODE_TYPES.JSXIdentifier:
|
|
572
571
|
return `<${node.name}>`;
|
|
573
572
|
case AST_NODE_TYPES.JSXMemberExpression:
|
|
574
|
-
return `${
|
|
573
|
+
return `${stringify(node.object, getText)}.${stringify(node.property, getText)}`;
|
|
575
574
|
case AST_NODE_TYPES.JSXNamespacedName:
|
|
576
575
|
return `${node.namespace.name}:${node.name.name}`;
|
|
577
576
|
case AST_NODE_TYPES.JSXText:
|
|
@@ -579,7 +578,7 @@ function toReadableNodeName(node, getText) {
|
|
|
579
578
|
case AST_NODE_TYPES.Literal:
|
|
580
579
|
return node.raw;
|
|
581
580
|
case AST_NODE_TYPES.MemberExpression:
|
|
582
|
-
return `${
|
|
581
|
+
return `${stringify(node.object, getText)}.${stringify(node.property, getText)}`;
|
|
583
582
|
default:
|
|
584
583
|
return getText(node);
|
|
585
584
|
}
|
|
@@ -597,4 +596,4 @@ function toReadableNodeType(node) {
|
|
|
597
596
|
return toLowerCase(delimiterCase(node.type, " "));
|
|
598
597
|
}
|
|
599
598
|
|
|
600
|
-
export { findParentNode, getArrayMethodCallbackIndexParamPosition, getClassIdentifier, getEcmaExpression, getFunctionIdentifier, getFunctionInitPath, getLiteralValueType, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall, isArrayTupleType, isClass, isConditional, isControlFlow, isDestructuringPattern, isEmptyFunction, isFunction, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLeftHandSideExpression, isLeftHandSideExpressionType, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpression, isTypeAssertionExpression, isTypeDeclaration, isTypeExpression,
|
|
599
|
+
export { findParentNode, getArrayMethodCallbackIndexParamPosition, getClassIdentifier, getEcmaExpression, getFunctionIdentifier, getFunctionInitPath, getLiteralValueType, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall, isArrayTupleType, isClass, isConditional, isControlFlow, isDestructuringPattern, isEmptyFunction, isFunction, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLeftHandSideExpression, isLeftHandSideExpressionType, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpression, isTypeAssertionExpression, isTypeDeclaration, isTypeExpression, stringify, toReadableNodeType };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/ast",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.0-beta.2",
|
|
4
4
|
"description": "ESLint React's TSESTree AST utility module.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@typescript-eslint/utils": "^8.29.1",
|
|
41
41
|
"string-ts": "^2.2.1",
|
|
42
42
|
"ts-pattern": "^5.7.0",
|
|
43
|
-
"@eslint-react/eff": "1.
|
|
43
|
+
"@eslint-react/eff": "1.47.0-beta.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"tsup": "^8.4.0",
|