@eslint-react/ast 5.2.5-beta.0 → 5.2.5-beta.1
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 +4 -4
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ type TSESTreeDirective = TSESTree.ExpressionStatement & {
|
|
|
13
13
|
};
|
|
14
14
|
type TSESTreeTypeExpression = TSESTree.TSAsExpression | TSESTree.TSTypeAssertion | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSInstantiationExpression;
|
|
15
15
|
declare namespace check_d_exports {
|
|
16
|
-
export { is, isClass, isDirective, isFunction, isIdentifier, isJSX, isJSXElement,
|
|
16
|
+
export { is, isClass, isDirective, isFunction, isIdentifier, isJSX, isJSXElement, isJSXElementOrFragment, isJSXFragment, isJSXTagNameExpression, isLiteral, isOneOf, isProperty, isPropertyOrMethod, isTypeAssertionExpression, isTypeExpression };
|
|
17
17
|
}
|
|
18
18
|
declare const is: <NodeType extends AST_NODE_TYPES>(nodeType: NodeType) => (node: TSESTree.Node | null | undefined) => node is Extract<TSESTree.Node, {
|
|
19
19
|
type: NodeType;
|
|
@@ -29,13 +29,13 @@ declare function isLiteral(kind: "regexp"): (node: TSESTree.Node) => node is TSE
|
|
|
29
29
|
declare function isLiteral(kind: "string"): (node: TSESTree.Node) => node is TSESTree.StringLiteral;
|
|
30
30
|
declare function isDirective(name: string): (node: TSESTree.Node) => node is TSESTreeDirective;
|
|
31
31
|
declare function isIdentifier(name: string): (node: TSESTree.Node) => node is TSESTree.Identifier;
|
|
32
|
-
declare const isFunction: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression;
|
|
33
32
|
declare const isClass: (node: TSESTree.Node | null | undefined) => node is TSESTree.ClassDeclarationWithName | TSESTree.ClassDeclarationWithOptionalName | TSESTree.ClassExpression;
|
|
34
|
-
declare const
|
|
33
|
+
declare const isFunction: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression;
|
|
35
34
|
declare const isProperty: (node: TSESTree.Node | null | undefined) => node is TSESTree.PropertyDefinitionComputedName | TSESTree.PropertyDefinitionNonComputedName | TSESTree.TSIndexSignature | TSESTree.TSParameterProperty | TSESTree.TSPropertySignatureComputedName | TSESTree.TSPropertySignatureNonComputedName;
|
|
35
|
+
declare const isPropertyOrMethod: (node: TSESTree.Node | null | undefined) => node is TSESTree.MethodDefinitionComputedName | TSESTree.MethodDefinitionNonComputedName | TSESTree.PropertyDefinitionComputedName | TSESTree.PropertyDefinitionNonComputedName;
|
|
36
36
|
declare const isJSXElement: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXElement;
|
|
37
37
|
declare const isJSXFragment: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXFragment;
|
|
38
|
-
declare const
|
|
38
|
+
declare const isJSXElementOrFragment: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXElement | TSESTree.JSXFragment;
|
|
39
39
|
declare const isJSXTagNameExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.JSXIdentifier | TSESTree.JSXMemberExpression | TSESTree.JSXNamespacedName;
|
|
40
40
|
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;
|
|
41
41
|
declare const isTypeExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion;
|
package/dist/index.js
CHANGED
|
@@ -12,13 +12,13 @@ var check_exports = /* @__PURE__ */ __exportAll({
|
|
|
12
12
|
isIdentifier: () => isIdentifier,
|
|
13
13
|
isJSX: () => isJSX,
|
|
14
14
|
isJSXElement: () => isJSXElement,
|
|
15
|
+
isJSXElementOrFragment: () => isJSXElementOrFragment,
|
|
15
16
|
isJSXFragment: () => isJSXFragment,
|
|
16
|
-
isJSXLike: () => isJSXLike,
|
|
17
17
|
isJSXTagNameExpression: () => isJSXTagNameExpression,
|
|
18
18
|
isLiteral: () => isLiteral,
|
|
19
|
-
isMethodOrProperty: () => isMethodOrProperty,
|
|
20
19
|
isOneOf: () => isOneOf,
|
|
21
20
|
isProperty: () => isProperty,
|
|
21
|
+
isPropertyOrMethod: () => isPropertyOrMethod,
|
|
22
22
|
isTypeAssertionExpression: () => isTypeAssertionExpression,
|
|
23
23
|
isTypeExpression: () => isTypeExpression
|
|
24
24
|
});
|
|
@@ -44,22 +44,22 @@ function isDirective(name) {
|
|
|
44
44
|
function isIdentifier(name) {
|
|
45
45
|
return (node) => node.type === AST_NODE_TYPES.Identifier && node.name === name;
|
|
46
46
|
}
|
|
47
|
+
const isClass = isOneOf([AST_NODE_TYPES.ClassDeclaration, AST_NODE_TYPES.ClassExpression]);
|
|
47
48
|
const isFunction = isOneOf([
|
|
48
49
|
AST_NODE_TYPES.ArrowFunctionExpression,
|
|
49
50
|
AST_NODE_TYPES.FunctionDeclaration,
|
|
50
51
|
AST_NODE_TYPES.FunctionExpression
|
|
51
52
|
]);
|
|
52
|
-
const isClass = isOneOf([AST_NODE_TYPES.ClassDeclaration, AST_NODE_TYPES.ClassExpression]);
|
|
53
|
-
const isMethodOrProperty = isOneOf([AST_NODE_TYPES.PropertyDefinition, AST_NODE_TYPES.MethodDefinition]);
|
|
54
53
|
const isProperty = isOneOf([
|
|
55
54
|
AST_NODE_TYPES.PropertyDefinition,
|
|
56
55
|
AST_NODE_TYPES.TSIndexSignature,
|
|
57
56
|
AST_NODE_TYPES.TSParameterProperty,
|
|
58
57
|
AST_NODE_TYPES.TSPropertySignature
|
|
59
58
|
]);
|
|
59
|
+
const isPropertyOrMethod = isOneOf([AST_NODE_TYPES.PropertyDefinition, AST_NODE_TYPES.MethodDefinition]);
|
|
60
60
|
const isJSXElement = is(AST_NODE_TYPES.JSXElement);
|
|
61
61
|
const isJSXFragment = is(AST_NODE_TYPES.JSXFragment);
|
|
62
|
-
const
|
|
62
|
+
const isJSXElementOrFragment = isOneOf([AST_NODE_TYPES.JSXElement, AST_NODE_TYPES.JSXFragment]);
|
|
63
63
|
const isJSXTagNameExpression = isOneOf([
|
|
64
64
|
AST_NODE_TYPES.JSXIdentifier,
|
|
65
65
|
AST_NODE_TYPES.JSXMemberExpression,
|