@eslint-react/ast 1.52.3-next.9 → 1.52.3
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 +2 -9
- package/dist/index.d.ts +2 -9
- package/dist/index.js +6 -83
- package/dist/index.mjs +8 -78
- package/package.json +5 -6
package/dist/index.d.mts
CHANGED
|
@@ -207,19 +207,12 @@ declare const isFunction: (node: TSESTree.Node | null | undefined) => node is TS
|
|
|
207
207
|
declare const isFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSDeclareFunctionNoDeclare | TSESTree.TSDeclareFunctionWithDeclare | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignatureComputedName | TSESTree.TSMethodSignatureNonComputedName;
|
|
208
208
|
declare const isClass: (node: TSESTree.Node | null | undefined) => node is TSESTree.ClassDeclarationWithName | TSESTree.ClassDeclarationWithOptionalName | TSESTree.ClassExpression;
|
|
209
209
|
declare const isMethodOrProperty: (node: TSESTree.Node | null | undefined) => node is TSESTree.MethodDefinitionComputedName | TSESTree.MethodDefinitionNonComputedName | TSESTree.PropertyDefinitionComputedName | TSESTree.PropertyDefinitionNonComputedName;
|
|
210
|
-
declare const isLoop: (node: TSESTree.Node | null | undefined) => node is TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.WhileStatement;
|
|
211
|
-
declare const isControlFlow: (data: TSESTree.Node | null | undefined) => data is TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.IfStatement | TSESTree.SwitchStatement | TSESTree.WhileStatement;
|
|
212
|
-
declare const isConditional: (data: TSESTree.Node | null | undefined) => data is TSESTree.ConditionalExpression | TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.IfStatement | TSESTree.LogicalExpression | TSESTree.SwitchStatement | TSESTree.WhileStatement;
|
|
213
|
-
declare const isArrayTupleType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSArrayType | TSESTree.TSTupleType;
|
|
214
210
|
declare const isProperty: (node: TSESTree.Node | null | undefined) => node is TSESTree.PropertyDefinitionComputedName | TSESTree.PropertyDefinitionNonComputedName | TSESTree.TSIndexSignature | TSESTree.TSParameterProperty | TSESTree.TSPropertySignatureComputedName | TSESTree.TSPropertySignatureNonComputedName;
|
|
215
211
|
declare const isJSXElement: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXElement;
|
|
216
212
|
declare const isJSXFragment: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXFragment;
|
|
217
213
|
declare const isJSXTagNameExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXIdentifier | TSESTree.JSXMemberExpression | TSESTree.JSXNamespacedName;
|
|
218
214
|
declare const isJSX: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXAttribute | TSESTree.JSXClosingElement | TSESTree.JSXClosingFragment | TSESTree.JSXElement | TSESTree.JSXEmptyExpression | TSESTree.JSXExpressionContainer | TSESTree.JSXFragment | TSESTree.JSXIdentifier | TSESTree.JSXMemberExpression | TSESTree.JSXNamespacedName | TSESTree.JSXOpeningElement | TSESTree.JSXOpeningFragment | TSESTree.JSXSpreadAttribute | TSESTree.JSXSpreadChild | TSESTree.JSXText;
|
|
219
|
-
declare const
|
|
220
|
-
declare const isTypeDeclaration: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSInterfaceDeclaration | TSESTree.TSTypeAliasDeclaration;
|
|
221
|
-
declare const isLeftHandSideExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.CallExpression | TSESTree.ClassExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.TemplateLiteral | TSESTree.ThisExpression;
|
|
222
|
-
declare const isLeftHandSideExpressionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.CallExpression | TSESTree.ClassExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.TemplateLiteral | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSNonNullExpression | TSESTree.TSTypeAssertion;
|
|
215
|
+
declare const isLoop: (node: TSESTree.Node | null | undefined) => node is TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.WhileStatement;
|
|
223
216
|
declare const isTypeExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion;
|
|
224
217
|
declare const isTypeAssertionExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSAsExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion;
|
|
225
218
|
|
|
@@ -281,4 +274,4 @@ declare function toDelimiterCaseType(node: TSESTree.Node, delimiter?: string): "
|
|
|
281
274
|
*/
|
|
282
275
|
declare function toString(node: TSESTree.Node, getText: (node: TSESTree.Node) => string): string;
|
|
283
276
|
|
|
284
|
-
export { type FunctionInitPath, 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, getClassId, getFunctionId, getFunctionInitPath, getJSExpression, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall,
|
|
277
|
+
export { type FunctionInitPath, 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, getClassId, getFunctionId, getFunctionInitPath, getJSExpression, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall, isClass, isEmptyFunction, isFunction, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpression, isTypeAssertionExpression, isTypeExpression, toDelimiterCaseType, toString };
|
package/dist/index.d.ts
CHANGED
|
@@ -207,19 +207,12 @@ declare const isFunction: (node: TSESTree.Node | null | undefined) => node is TS
|
|
|
207
207
|
declare const isFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSDeclareFunctionNoDeclare | TSESTree.TSDeclareFunctionWithDeclare | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignatureComputedName | TSESTree.TSMethodSignatureNonComputedName;
|
|
208
208
|
declare const isClass: (node: TSESTree.Node | null | undefined) => node is TSESTree.ClassDeclarationWithName | TSESTree.ClassDeclarationWithOptionalName | TSESTree.ClassExpression;
|
|
209
209
|
declare const isMethodOrProperty: (node: TSESTree.Node | null | undefined) => node is TSESTree.MethodDefinitionComputedName | TSESTree.MethodDefinitionNonComputedName | TSESTree.PropertyDefinitionComputedName | TSESTree.PropertyDefinitionNonComputedName;
|
|
210
|
-
declare const isLoop: (node: TSESTree.Node | null | undefined) => node is TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.WhileStatement;
|
|
211
|
-
declare const isControlFlow: (data: TSESTree.Node | null | undefined) => data is TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.IfStatement | TSESTree.SwitchStatement | TSESTree.WhileStatement;
|
|
212
|
-
declare const isConditional: (data: TSESTree.Node | null | undefined) => data is TSESTree.ConditionalExpression | TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.IfStatement | TSESTree.LogicalExpression | TSESTree.SwitchStatement | TSESTree.WhileStatement;
|
|
213
|
-
declare const isArrayTupleType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSArrayType | TSESTree.TSTupleType;
|
|
214
210
|
declare const isProperty: (node: TSESTree.Node | null | undefined) => node is TSESTree.PropertyDefinitionComputedName | TSESTree.PropertyDefinitionNonComputedName | TSESTree.TSIndexSignature | TSESTree.TSParameterProperty | TSESTree.TSPropertySignatureComputedName | TSESTree.TSPropertySignatureNonComputedName;
|
|
215
211
|
declare const isJSXElement: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXElement;
|
|
216
212
|
declare const isJSXFragment: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXFragment;
|
|
217
213
|
declare const isJSXTagNameExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXIdentifier | TSESTree.JSXMemberExpression | TSESTree.JSXNamespacedName;
|
|
218
214
|
declare const isJSX: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXAttribute | TSESTree.JSXClosingElement | TSESTree.JSXClosingFragment | TSESTree.JSXElement | TSESTree.JSXEmptyExpression | TSESTree.JSXExpressionContainer | TSESTree.JSXFragment | TSESTree.JSXIdentifier | TSESTree.JSXMemberExpression | TSESTree.JSXNamespacedName | TSESTree.JSXOpeningElement | TSESTree.JSXOpeningFragment | TSESTree.JSXSpreadAttribute | TSESTree.JSXSpreadChild | TSESTree.JSXText;
|
|
219
|
-
declare const
|
|
220
|
-
declare const isTypeDeclaration: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSInterfaceDeclaration | TSESTree.TSTypeAliasDeclaration;
|
|
221
|
-
declare const isLeftHandSideExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.CallExpression | TSESTree.ClassExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.TemplateLiteral | TSESTree.ThisExpression;
|
|
222
|
-
declare const isLeftHandSideExpressionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.CallExpression | TSESTree.ClassExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.TemplateLiteral | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSNonNullExpression | TSESTree.TSTypeAssertion;
|
|
215
|
+
declare const isLoop: (node: TSESTree.Node | null | undefined) => node is TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.WhileStatement;
|
|
223
216
|
declare const isTypeExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion;
|
|
224
217
|
declare const isTypeAssertionExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSAsExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion;
|
|
225
218
|
|
|
@@ -281,4 +274,4 @@ declare function toDelimiterCaseType(node: TSESTree.Node, delimiter?: string): "
|
|
|
281
274
|
*/
|
|
282
275
|
declare function toString(node: TSESTree.Node, getText: (node: TSESTree.Node) => string): string;
|
|
283
276
|
|
|
284
|
-
export { type FunctionInitPath, 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, getClassId, getFunctionId, getFunctionInitPath, getJSExpression, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall,
|
|
277
|
+
export { type FunctionInitPath, 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, getClassId, getFunctionId, getFunctionInitPath, getJSExpression, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall, isClass, isEmptyFunction, isFunction, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpression, isTypeAssertionExpression, isTypeExpression, toDelimiterCaseType, toString };
|
package/dist/index.js
CHANGED
|
@@ -70,28 +70,6 @@ var isMethodOrProperty = isOneOf([
|
|
|
70
70
|
types.AST_NODE_TYPES.PropertyDefinition,
|
|
71
71
|
types.AST_NODE_TYPES.MethodDefinition
|
|
72
72
|
]);
|
|
73
|
-
var isLoop = isOneOf([
|
|
74
|
-
types.AST_NODE_TYPES.DoWhileStatement,
|
|
75
|
-
types.AST_NODE_TYPES.ForInStatement,
|
|
76
|
-
types.AST_NODE_TYPES.ForOfStatement,
|
|
77
|
-
types.AST_NODE_TYPES.ForStatement,
|
|
78
|
-
types.AST_NODE_TYPES.WhileStatement
|
|
79
|
-
]);
|
|
80
|
-
var isControlFlow = eff.or(
|
|
81
|
-
isLoop,
|
|
82
|
-
isOneOf([
|
|
83
|
-
types.AST_NODE_TYPES.IfStatement,
|
|
84
|
-
types.AST_NODE_TYPES.SwitchStatement
|
|
85
|
-
])
|
|
86
|
-
);
|
|
87
|
-
var isConditional = eff.or(
|
|
88
|
-
isControlFlow,
|
|
89
|
-
isOneOf([
|
|
90
|
-
types.AST_NODE_TYPES.LogicalExpression,
|
|
91
|
-
types.AST_NODE_TYPES.ConditionalExpression
|
|
92
|
-
])
|
|
93
|
-
);
|
|
94
|
-
var isArrayTupleType = isOneOf([types.AST_NODE_TYPES.TSArrayType, types.AST_NODE_TYPES.TSTupleType]);
|
|
95
73
|
var isProperty = isOneOf([
|
|
96
74
|
types.AST_NODE_TYPES.PropertyDefinition,
|
|
97
75
|
types.AST_NODE_TYPES.TSIndexSignature,
|
|
@@ -122,60 +100,12 @@ var isJSX = isOneOf([
|
|
|
122
100
|
types.AST_NODE_TYPES.JSXSpreadChild,
|
|
123
101
|
types.AST_NODE_TYPES.JSXText
|
|
124
102
|
]);
|
|
125
|
-
var
|
|
126
|
-
types.AST_NODE_TYPES.
|
|
127
|
-
types.AST_NODE_TYPES.
|
|
128
|
-
types.AST_NODE_TYPES.
|
|
129
|
-
types.AST_NODE_TYPES.
|
|
130
|
-
|
|
131
|
-
var isTypeDeclaration = isOneOf([
|
|
132
|
-
types.AST_NODE_TYPES.TSInterfaceDeclaration,
|
|
133
|
-
types.AST_NODE_TYPES.TSTypeAliasDeclaration
|
|
134
|
-
]);
|
|
135
|
-
var isLeftHandSideExpression = isOneOf([
|
|
136
|
-
types.AST_NODE_TYPES.ArrayExpression,
|
|
137
|
-
types.AST_NODE_TYPES.ArrayPattern,
|
|
138
|
-
types.AST_NODE_TYPES.ArrowFunctionExpression,
|
|
139
|
-
types.AST_NODE_TYPES.CallExpression,
|
|
140
|
-
types.AST_NODE_TYPES.ClassExpression,
|
|
141
|
-
types.AST_NODE_TYPES.FunctionExpression,
|
|
142
|
-
types.AST_NODE_TYPES.Identifier,
|
|
143
|
-
types.AST_NODE_TYPES.JSXElement,
|
|
144
|
-
types.AST_NODE_TYPES.JSXFragment,
|
|
145
|
-
types.AST_NODE_TYPES.Literal,
|
|
146
|
-
types.AST_NODE_TYPES.TemplateLiteral,
|
|
147
|
-
types.AST_NODE_TYPES.MemberExpression,
|
|
148
|
-
types.AST_NODE_TYPES.MetaProperty,
|
|
149
|
-
types.AST_NODE_TYPES.ObjectExpression,
|
|
150
|
-
types.AST_NODE_TYPES.ObjectPattern,
|
|
151
|
-
types.AST_NODE_TYPES.SequenceExpression,
|
|
152
|
-
types.AST_NODE_TYPES.Super,
|
|
153
|
-
types.AST_NODE_TYPES.TaggedTemplateExpression,
|
|
154
|
-
types.AST_NODE_TYPES.ThisExpression
|
|
155
|
-
]);
|
|
156
|
-
var isLeftHandSideExpressionType = isOneOf([
|
|
157
|
-
types.AST_NODE_TYPES.ArrayExpression,
|
|
158
|
-
types.AST_NODE_TYPES.ArrayPattern,
|
|
159
|
-
types.AST_NODE_TYPES.ArrowFunctionExpression,
|
|
160
|
-
types.AST_NODE_TYPES.CallExpression,
|
|
161
|
-
types.AST_NODE_TYPES.ClassExpression,
|
|
162
|
-
types.AST_NODE_TYPES.FunctionExpression,
|
|
163
|
-
types.AST_NODE_TYPES.Identifier,
|
|
164
|
-
types.AST_NODE_TYPES.JSXElement,
|
|
165
|
-
types.AST_NODE_TYPES.JSXFragment,
|
|
166
|
-
types.AST_NODE_TYPES.Literal,
|
|
167
|
-
types.AST_NODE_TYPES.TemplateLiteral,
|
|
168
|
-
types.AST_NODE_TYPES.MemberExpression,
|
|
169
|
-
types.AST_NODE_TYPES.MetaProperty,
|
|
170
|
-
types.AST_NODE_TYPES.ObjectExpression,
|
|
171
|
-
types.AST_NODE_TYPES.ObjectPattern,
|
|
172
|
-
types.AST_NODE_TYPES.SequenceExpression,
|
|
173
|
-
types.AST_NODE_TYPES.Super,
|
|
174
|
-
types.AST_NODE_TYPES.TaggedTemplateExpression,
|
|
175
|
-
types.AST_NODE_TYPES.ThisExpression,
|
|
176
|
-
types.AST_NODE_TYPES.TSAsExpression,
|
|
177
|
-
types.AST_NODE_TYPES.TSNonNullExpression,
|
|
178
|
-
types.AST_NODE_TYPES.TSTypeAssertion
|
|
103
|
+
var isLoop = isOneOf([
|
|
104
|
+
types.AST_NODE_TYPES.DoWhileStatement,
|
|
105
|
+
types.AST_NODE_TYPES.ForInStatement,
|
|
106
|
+
types.AST_NODE_TYPES.ForOfStatement,
|
|
107
|
+
types.AST_NODE_TYPES.ForStatement,
|
|
108
|
+
types.AST_NODE_TYPES.WhileStatement
|
|
179
109
|
]);
|
|
180
110
|
var isTypeExpression = isOneOf([
|
|
181
111
|
types.AST_NODE_TYPES.TSAsExpression,
|
|
@@ -604,11 +534,7 @@ exports.hasCallInFunctionInitPath = hasCallInFunctionInitPath;
|
|
|
604
534
|
exports.is = is;
|
|
605
535
|
exports.isArrayFromCall = isArrayFromCall;
|
|
606
536
|
exports.isArrayMapCall = isArrayMapCall;
|
|
607
|
-
exports.isArrayTupleType = isArrayTupleType;
|
|
608
537
|
exports.isClass = isClass;
|
|
609
|
-
exports.isConditional = isConditional;
|
|
610
|
-
exports.isControlFlow = isControlFlow;
|
|
611
|
-
exports.isDestructuringPattern = isDestructuringPattern;
|
|
612
538
|
exports.isEmptyFunction = isEmptyFunction;
|
|
613
539
|
exports.isFunction = isFunction;
|
|
614
540
|
exports.isFunctionType = isFunctionType;
|
|
@@ -616,8 +542,6 @@ exports.isJSX = isJSX;
|
|
|
616
542
|
exports.isJSXElement = isJSXElement;
|
|
617
543
|
exports.isJSXFragment = isJSXFragment;
|
|
618
544
|
exports.isJSXTagNameExpression = isJSXTagNameExpression;
|
|
619
|
-
exports.isLeftHandSideExpression = isLeftHandSideExpression;
|
|
620
|
-
exports.isLeftHandSideExpressionType = isLeftHandSideExpressionType;
|
|
621
545
|
exports.isLineBreak = isLineBreak;
|
|
622
546
|
exports.isLiteral = isLiteral;
|
|
623
547
|
exports.isLoop = isLoop;
|
|
@@ -630,7 +554,6 @@ exports.isProcessEnvNodeEnvCompare = isProcessEnvNodeEnvCompare;
|
|
|
630
554
|
exports.isProperty = isProperty;
|
|
631
555
|
exports.isThisExpression = isThisExpression;
|
|
632
556
|
exports.isTypeAssertionExpression = isTypeAssertionExpression;
|
|
633
|
-
exports.isTypeDeclaration = isTypeDeclaration;
|
|
634
557
|
exports.isTypeExpression = isTypeExpression;
|
|
635
558
|
exports.toDelimiterCaseType = toDelimiterCaseType;
|
|
636
559
|
exports.toString = toString;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
2
|
-
import {
|
|
2
|
+
import { dual, unit } from '@eslint-react/eff';
|
|
3
3
|
import { ASTUtils } from '@typescript-eslint/utils';
|
|
4
4
|
import { simpleTraverse } from '@typescript-eslint/typescript-estree';
|
|
5
5
|
import { toLowerCase, delimiterCase, replace } from 'string-ts';
|
|
@@ -68,28 +68,6 @@ var isMethodOrProperty = isOneOf([
|
|
|
68
68
|
AST_NODE_TYPES.PropertyDefinition,
|
|
69
69
|
AST_NODE_TYPES.MethodDefinition
|
|
70
70
|
]);
|
|
71
|
-
var isLoop = isOneOf([
|
|
72
|
-
AST_NODE_TYPES.DoWhileStatement,
|
|
73
|
-
AST_NODE_TYPES.ForInStatement,
|
|
74
|
-
AST_NODE_TYPES.ForOfStatement,
|
|
75
|
-
AST_NODE_TYPES.ForStatement,
|
|
76
|
-
AST_NODE_TYPES.WhileStatement
|
|
77
|
-
]);
|
|
78
|
-
var isControlFlow = or(
|
|
79
|
-
isLoop,
|
|
80
|
-
isOneOf([
|
|
81
|
-
AST_NODE_TYPES.IfStatement,
|
|
82
|
-
AST_NODE_TYPES.SwitchStatement
|
|
83
|
-
])
|
|
84
|
-
);
|
|
85
|
-
var isConditional = or(
|
|
86
|
-
isControlFlow,
|
|
87
|
-
isOneOf([
|
|
88
|
-
AST_NODE_TYPES.LogicalExpression,
|
|
89
|
-
AST_NODE_TYPES.ConditionalExpression
|
|
90
|
-
])
|
|
91
|
-
);
|
|
92
|
-
var isArrayTupleType = isOneOf([AST_NODE_TYPES.TSArrayType, AST_NODE_TYPES.TSTupleType]);
|
|
93
71
|
var isProperty = isOneOf([
|
|
94
72
|
AST_NODE_TYPES.PropertyDefinition,
|
|
95
73
|
AST_NODE_TYPES.TSIndexSignature,
|
|
@@ -120,60 +98,12 @@ var isJSX = isOneOf([
|
|
|
120
98
|
AST_NODE_TYPES.JSXSpreadChild,
|
|
121
99
|
AST_NODE_TYPES.JSXText
|
|
122
100
|
]);
|
|
123
|
-
var
|
|
124
|
-
AST_NODE_TYPES.
|
|
125
|
-
AST_NODE_TYPES.
|
|
126
|
-
AST_NODE_TYPES.
|
|
127
|
-
AST_NODE_TYPES.
|
|
128
|
-
|
|
129
|
-
var isTypeDeclaration = isOneOf([
|
|
130
|
-
AST_NODE_TYPES.TSInterfaceDeclaration,
|
|
131
|
-
AST_NODE_TYPES.TSTypeAliasDeclaration
|
|
132
|
-
]);
|
|
133
|
-
var isLeftHandSideExpression = isOneOf([
|
|
134
|
-
AST_NODE_TYPES.ArrayExpression,
|
|
135
|
-
AST_NODE_TYPES.ArrayPattern,
|
|
136
|
-
AST_NODE_TYPES.ArrowFunctionExpression,
|
|
137
|
-
AST_NODE_TYPES.CallExpression,
|
|
138
|
-
AST_NODE_TYPES.ClassExpression,
|
|
139
|
-
AST_NODE_TYPES.FunctionExpression,
|
|
140
|
-
AST_NODE_TYPES.Identifier,
|
|
141
|
-
AST_NODE_TYPES.JSXElement,
|
|
142
|
-
AST_NODE_TYPES.JSXFragment,
|
|
143
|
-
AST_NODE_TYPES.Literal,
|
|
144
|
-
AST_NODE_TYPES.TemplateLiteral,
|
|
145
|
-
AST_NODE_TYPES.MemberExpression,
|
|
146
|
-
AST_NODE_TYPES.MetaProperty,
|
|
147
|
-
AST_NODE_TYPES.ObjectExpression,
|
|
148
|
-
AST_NODE_TYPES.ObjectPattern,
|
|
149
|
-
AST_NODE_TYPES.SequenceExpression,
|
|
150
|
-
AST_NODE_TYPES.Super,
|
|
151
|
-
AST_NODE_TYPES.TaggedTemplateExpression,
|
|
152
|
-
AST_NODE_TYPES.ThisExpression
|
|
153
|
-
]);
|
|
154
|
-
var isLeftHandSideExpressionType = isOneOf([
|
|
155
|
-
AST_NODE_TYPES.ArrayExpression,
|
|
156
|
-
AST_NODE_TYPES.ArrayPattern,
|
|
157
|
-
AST_NODE_TYPES.ArrowFunctionExpression,
|
|
158
|
-
AST_NODE_TYPES.CallExpression,
|
|
159
|
-
AST_NODE_TYPES.ClassExpression,
|
|
160
|
-
AST_NODE_TYPES.FunctionExpression,
|
|
161
|
-
AST_NODE_TYPES.Identifier,
|
|
162
|
-
AST_NODE_TYPES.JSXElement,
|
|
163
|
-
AST_NODE_TYPES.JSXFragment,
|
|
164
|
-
AST_NODE_TYPES.Literal,
|
|
165
|
-
AST_NODE_TYPES.TemplateLiteral,
|
|
166
|
-
AST_NODE_TYPES.MemberExpression,
|
|
167
|
-
AST_NODE_TYPES.MetaProperty,
|
|
168
|
-
AST_NODE_TYPES.ObjectExpression,
|
|
169
|
-
AST_NODE_TYPES.ObjectPattern,
|
|
170
|
-
AST_NODE_TYPES.SequenceExpression,
|
|
171
|
-
AST_NODE_TYPES.Super,
|
|
172
|
-
AST_NODE_TYPES.TaggedTemplateExpression,
|
|
173
|
-
AST_NODE_TYPES.ThisExpression,
|
|
174
|
-
AST_NODE_TYPES.TSAsExpression,
|
|
175
|
-
AST_NODE_TYPES.TSNonNullExpression,
|
|
176
|
-
AST_NODE_TYPES.TSTypeAssertion
|
|
101
|
+
var isLoop = isOneOf([
|
|
102
|
+
AST_NODE_TYPES.DoWhileStatement,
|
|
103
|
+
AST_NODE_TYPES.ForInStatement,
|
|
104
|
+
AST_NODE_TYPES.ForOfStatement,
|
|
105
|
+
AST_NODE_TYPES.ForStatement,
|
|
106
|
+
AST_NODE_TYPES.WhileStatement
|
|
177
107
|
]);
|
|
178
108
|
var isTypeExpression = isOneOf([
|
|
179
109
|
AST_NODE_TYPES.TSAsExpression,
|
|
@@ -586,4 +516,4 @@ function toString(node, getText) {
|
|
|
586
516
|
}
|
|
587
517
|
}
|
|
588
518
|
|
|
589
|
-
export { findParentNode, getArrayMethodCallbackIndexParamPosition, getClassId, getFunctionId, getFunctionInitPath, getJSExpression, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall,
|
|
519
|
+
export { findParentNode, getArrayMethodCallbackIndexParamPosition, getClassId, getFunctionId, getFunctionInitPath, getJSExpression, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, hasCallInFunctionInitPath, is, isArrayFromCall, isArrayMapCall, isClass, isEmptyFunction, isFunction, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpression, isTypeAssertionExpression, isTypeExpression, toDelimiterCaseType, toString };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/ast",
|
|
3
|
-
"version": "1.52.3
|
|
3
|
+
"version": "1.52.3",
|
|
4
4
|
"description": "ESLint React's TSESTree AST utility module.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -35,19 +35,18 @@
|
|
|
35
35
|
"./package.json"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@typescript-eslint/types": "^8.
|
|
39
|
-
"@typescript-eslint/typescript-estree": "^8.
|
|
40
|
-
"@typescript-eslint/utils": "^8.
|
|
38
|
+
"@typescript-eslint/types": "^8.36.0",
|
|
39
|
+
"@typescript-eslint/typescript-estree": "^8.36.0",
|
|
40
|
+
"@typescript-eslint/utils": "^8.36.0",
|
|
41
41
|
"string-ts": "^2.2.1",
|
|
42
42
|
"ts-pattern": "^5.7.1",
|
|
43
|
-
"@eslint-react/eff": "1.52.3
|
|
43
|
+
"@eslint-react/eff": "1.52.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"tsup": "^8.5.0",
|
|
47
47
|
"@local/configs": "0.0.0"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
|
-
"bun": ">=1.0.15",
|
|
51
50
|
"node": ">=18.18.0"
|
|
52
51
|
},
|
|
53
52
|
"scripts": {
|