@eslint-react/ast 2.7.4-next.2 → 2.7.4-next.4
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 +8 -1
- package/dist/index.js +16 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -126,6 +126,13 @@ declare function hasCallInFunctionInitPath(callName: string, initPath: FunctionI
|
|
|
126
126
|
declare function isFunctionEmpty(node: TSESTreeFunction): boolean;
|
|
127
127
|
declare function isFunctionImmediatelyInvoked(node: TSESTreeFunction): boolean;
|
|
128
128
|
//#endregion
|
|
129
|
+
//#region src/identifier-is.d.ts
|
|
130
|
+
declare function isNaN(node: TSESTree.Node | null | unit): node is TSESTree.Identifier;
|
|
131
|
+
declare function isUndefined(node: TSESTree.Node | null | unit): node is TSESTree.Identifier;
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/identifier-name.d.ts
|
|
134
|
+
declare function isIdentifierName(name: string): boolean;
|
|
135
|
+
//#endregion
|
|
129
136
|
//#region src/is.d.ts
|
|
130
137
|
declare const is: <NodeType extends TSESTree.AST_NODE_TYPES>(nodeType: NodeType) => (node: TSESTree.Node | null | undefined) => node is Extract<TSESTree.Node, {
|
|
131
138
|
type: NodeType;
|
|
@@ -257,4 +264,4 @@ declare function isViMock(node: TSESTree.Node | null | unit): node is TSESTree.M
|
|
|
257
264
|
*/
|
|
258
265
|
declare function isViMockCallback(node: TSESTree.Node | null | unit): boolean;
|
|
259
266
|
//#endregion
|
|
260
|
-
export { DisplayNameAssignmentExpression, FunctionID, FunctionInitPath, ImplicitReturnArrowFunctionExpression, ObjectDestructuringVariableDeclarator, SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, TSESTreeArrayTupleType, TSESTreeClass, TSESTreeDestructuringPattern, TSESTreeFunction, TSESTreeFunctionType, TSESTreeJSX, TSESTreeJSXAttributeLike, TSESTreeLoop, TSESTreeMethodOrProperty, TSESTreeProperty, TSESTreeTypeAssertionExpression, TSESTreeTypeDeclaration, TSESTreeTypeExpression, findParentNode, getClassId, getFunctionId, getFunctionInitPath, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, getUnderlyingExpression, hasCallInFunctionInitPath, is, isClass, isConditional, isControlFlow, isFunction, isFunctionEmpty, isFunctionImmediatelyInvoked, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpressionLoose, isTypeAssertionExpression, isTypeExpression, isViMock, isViMockCallback, toDelimiterFormat, toStringFormat };
|
|
267
|
+
export { DisplayNameAssignmentExpression, FunctionID, FunctionInitPath, ImplicitReturnArrowFunctionExpression, ObjectDestructuringVariableDeclarator, SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, TSESTreeArrayTupleType, TSESTreeClass, TSESTreeDestructuringPattern, TSESTreeFunction, TSESTreeFunctionType, TSESTreeJSX, TSESTreeJSXAttributeLike, TSESTreeLoop, TSESTreeMethodOrProperty, TSESTreeProperty, TSESTreeTypeAssertionExpression, TSESTreeTypeDeclaration, TSESTreeTypeExpression, findParentNode, getClassId, getFunctionId, getFunctionInitPath, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, getUnderlyingExpression, hasCallInFunctionInitPath, is, isClass, isConditional, isControlFlow, isFunction, isFunctionEmpty, isFunctionImmediatelyInvoked, isFunctionType, isIdentifierName, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNaN, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpressionLoose, isTypeAssertionExpression, isTypeExpression, isUndefined, isViMock, isViMockCallback, toDelimiterFormat, toStringFormat };
|
package/dist/index.js
CHANGED
|
@@ -450,6 +450,21 @@ function isFunctionImmediatelyInvoked(node) {
|
|
|
450
450
|
return node.type !== AST_NODE_TYPES.FunctionDeclaration && node.parent.type === AST_NODE_TYPES.CallExpression && node.parent.callee === node;
|
|
451
451
|
}
|
|
452
452
|
|
|
453
|
+
//#endregion
|
|
454
|
+
//#region src/identifier-is.ts
|
|
455
|
+
function isNaN(node) {
|
|
456
|
+
return node != null && node.type === AST_NODE_TYPES.Identifier && node.name === "NaN";
|
|
457
|
+
}
|
|
458
|
+
function isUndefined(node) {
|
|
459
|
+
return node != null && node.type === AST_NODE_TYPES.Identifier && node.name === "undefined";
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
//#endregion
|
|
463
|
+
//#region src/identifier-name.ts
|
|
464
|
+
function isIdentifierName(name) {
|
|
465
|
+
return /^[A-Z$_][\w$]*$/i.test(name);
|
|
466
|
+
}
|
|
467
|
+
|
|
453
468
|
//#endregion
|
|
454
469
|
//#region src/literal.ts
|
|
455
470
|
function isLiteral(node, type) {
|
|
@@ -598,4 +613,4 @@ function isViMockCallback(node) {
|
|
|
598
613
|
}
|
|
599
614
|
|
|
600
615
|
//#endregion
|
|
601
|
-
export { SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, findParentNode, getClassId, getFunctionId, getFunctionInitPath, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, getUnderlyingExpression, hasCallInFunctionInitPath, is, isClass, isConditional, isControlFlow, isFunction, isFunctionEmpty, isFunctionImmediatelyInvoked, isFunctionType, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpressionLoose, isTypeAssertionExpression, isTypeExpression, isViMock, isViMockCallback, toDelimiterFormat, toStringFormat };
|
|
616
|
+
export { SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, findParentNode, getClassId, getFunctionId, getFunctionInitPath, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, getUnderlyingExpression, hasCallInFunctionInitPath, is, isClass, isConditional, isControlFlow, isFunction, isFunctionEmpty, isFunctionImmediatelyInvoked, isFunctionType, isIdentifierName, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNaN, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpressionLoose, isTypeAssertionExpression, isTypeExpression, isUndefined, isViMock, isViMockCallback, toDelimiterFormat, toStringFormat };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/ast",
|
|
3
|
-
"version": "2.7.4-next.
|
|
3
|
+
"version": "2.7.4-next.4",
|
|
4
4
|
"description": "ESLint React's TSESTree AST utility module.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@typescript-eslint/typescript-estree": "^8.53.1",
|
|
35
35
|
"@typescript-eslint/utils": "^8.53.1",
|
|
36
36
|
"string-ts": "^2.3.1",
|
|
37
|
-
"@eslint-react/eff": "2.7.4-next.
|
|
37
|
+
"@eslint-react/eff": "2.7.4-next.4"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"tsdown": "^0.20.0-beta.4",
|