@eslint-react/jsx 0.8.12 → 0.9.0-beta.0
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/README.md +10 -0
- package/dist/index.cjs +148 -7194
- package/dist/index.d.mts +9 -23
- package/dist/index.d.ts +9 -23
- package/dist/index.js +148 -7194
- package/dist/index.mjs +90 -7133
- package/package.json +8 -10
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { RuleContext } from '@eslint-react/shared';
|
|
2
1
|
import { TSESTree } from '@typescript-eslint/types';
|
|
2
|
+
import { RuleContext } from '@eslint-react/shared';
|
|
3
3
|
import { TSESTreeFunction } from '@eslint-react/ast';
|
|
4
4
|
import { O } from '@eslint-react/tools';
|
|
5
5
|
import { TSESTree as TSESTree$1 } from '@typescript-eslint/utils';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Returns the tag name associated with a JSXOpeningElement.
|
|
9
|
+
* @param node The visited JSXOpeningElement node object.
|
|
10
|
+
* @returns The element's tag name.
|
|
11
|
+
*/
|
|
12
|
+
declare function elementType(node: TSESTree.JSXOpeningElement | TSESTree.JSXOpeningFragment): string;
|
|
13
|
+
|
|
7
14
|
/**
|
|
8
15
|
* Determines whether inside createElement's props.
|
|
9
16
|
* @param node The AST node to check
|
|
@@ -69,13 +76,6 @@ declare const isCreateElementCall: CallFromPragmaPredicate;
|
|
|
69
76
|
*/
|
|
70
77
|
declare const isCloneElementCall: CallFromPragmaPredicate;
|
|
71
78
|
|
|
72
|
-
/**
|
|
73
|
-
* Returns the tag name associated with a JSXOpeningElement.
|
|
74
|
-
* @param node The visited JSXOpeningElement node object.
|
|
75
|
-
* @returns The element's tag name.
|
|
76
|
-
*/
|
|
77
|
-
declare function elementType(node: TSESTree.JSXOpeningElement | TSESTree.JSXOpeningFragment): string;
|
|
78
|
-
|
|
79
79
|
declare const hdlAnimation: readonly ["onAnimationStart", "onAnimationEnd", "onAnimationIteration"];
|
|
80
80
|
declare const hdlClipboard: readonly ["onCopy", "onCut", "onPaste"];
|
|
81
81
|
declare const hdlComposition: readonly ["onCompositionEnd", "onCompositionStart", "onCompositionUpdate"];
|
|
@@ -103,20 +103,6 @@ declare const isFragmentSyntax: (node: TSESTree.Node | null | undefined) => node
|
|
|
103
103
|
* @param fragment
|
|
104
104
|
*/
|
|
105
105
|
declare function isFragmentElement(node: TSESTree.JSXElement, pragma: string, fragment: string): boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Check if a JSXElement or JSXFragment has only one literal child and is not a child
|
|
108
|
-
* @param node The AST node to check
|
|
109
|
-
* @returns `true` if the node has only one literal child and is not a child
|
|
110
|
-
* @example Somehow fragment like this is useful: <Foo content={<>ee eeee eeee ...</>} />
|
|
111
|
-
*/
|
|
112
|
-
declare function isFragmentWithOnlyTextAndIsNotChild(node: TSESTree.JSXElement | TSESTree.JSXFragment): boolean;
|
|
113
|
-
/**
|
|
114
|
-
* Check if a JSXElement or JSXFragment has less than two non-padding children and the first child is not a call expression
|
|
115
|
-
* @param node The AST node to check
|
|
116
|
-
* @returns boolean
|
|
117
|
-
*/
|
|
118
|
-
declare function isFragmentHasLessThanTwoChildren(node: TSESTree.JSXElement | TSESTree.JSXFragment): boolean;
|
|
119
|
-
declare function isFragmentWithSingleExpression(node: TSESTree.JSXElement | TSESTree.JSXFragment): boolean;
|
|
120
106
|
|
|
121
107
|
/**
|
|
122
108
|
* Check if function is returning JSX
|
|
@@ -246,4 +232,4 @@ declare const defaultJSXValueCheckHint: bigint;
|
|
|
246
232
|
*/
|
|
247
233
|
declare function isJSXValue(node: TSESTree$1.Node | null | undefined, context: RuleContext, hint?: bigint): boolean;
|
|
248
234
|
|
|
249
|
-
export { type CallFromPragmaPredicate, JSXValueCheckHint, defaultJSXValueCheckHint, elementType, findPropInAttributes, findPropInProperties, getFragmentFromContext, getPragmaFromContext, getProp, getPropName, getPropValue, hasAnyProp, hasChildren, hasEveryProp, hasProp, hdlAnimation, hdlClipboard, hdlComposition, hdlFocus, hdlForm, hdlImage, hdlKeyboard, hdlMedia, hdlMouse, hdlScroll, hdlSelection, hdlTouch, hdlTransition, hdlWheel, isCallFromPragma, isChildOfJSXElement, isChildrenOfCreateElement, isCloneElementCall, isCreateElementCall, isFragment, isFragmentElement,
|
|
235
|
+
export { type CallFromPragmaPredicate, JSXValueCheckHint, defaultJSXValueCheckHint, elementType, findPropInAttributes, findPropInProperties, getFragmentFromContext, getPragmaFromContext, getProp, getPropName, getPropValue, hasAnyProp, hasChildren, hasEveryProp, hasProp, hdlAnimation, hdlClipboard, hdlComposition, hdlFocus, hdlForm, hdlImage, hdlKeyboard, hdlMedia, hdlMouse, hdlScroll, hdlSelection, hdlTouch, hdlTransition, hdlWheel, isCallFromPragma, isChildOfJSXElement, isChildrenOfCreateElement, isCloneElementCall, isCreateElementCall, isFragment, isFragmentElement, isFragmentSyntax, isFunctionReturningJSXValue, isInitializedFromPragma, isInsideCreateElementProps, isInsidePropValue, isJSXElementOfBuiltinComponent, isJSXElementOfUserDefinedComponent, isJSXValue, isLineBreak, isLiteral, isPaddingSpaces, isPropertyOfPragma, isWhiteSpace, traverseUpProp };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { RuleContext } from '@eslint-react/shared';
|
|
2
1
|
import { TSESTree } from '@typescript-eslint/types';
|
|
2
|
+
import { RuleContext } from '@eslint-react/shared';
|
|
3
3
|
import { TSESTreeFunction } from '@eslint-react/ast';
|
|
4
4
|
import { O } from '@eslint-react/tools';
|
|
5
5
|
import { TSESTree as TSESTree$1 } from '@typescript-eslint/utils';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Returns the tag name associated with a JSXOpeningElement.
|
|
9
|
+
* @param node The visited JSXOpeningElement node object.
|
|
10
|
+
* @returns The element's tag name.
|
|
11
|
+
*/
|
|
12
|
+
declare function elementType(node: TSESTree.JSXOpeningElement | TSESTree.JSXOpeningFragment): string;
|
|
13
|
+
|
|
7
14
|
/**
|
|
8
15
|
* Determines whether inside createElement's props.
|
|
9
16
|
* @param node The AST node to check
|
|
@@ -69,13 +76,6 @@ declare const isCreateElementCall: CallFromPragmaPredicate;
|
|
|
69
76
|
*/
|
|
70
77
|
declare const isCloneElementCall: CallFromPragmaPredicate;
|
|
71
78
|
|
|
72
|
-
/**
|
|
73
|
-
* Returns the tag name associated with a JSXOpeningElement.
|
|
74
|
-
* @param node The visited JSXOpeningElement node object.
|
|
75
|
-
* @returns The element's tag name.
|
|
76
|
-
*/
|
|
77
|
-
declare function elementType(node: TSESTree.JSXOpeningElement | TSESTree.JSXOpeningFragment): string;
|
|
78
|
-
|
|
79
79
|
declare const hdlAnimation: readonly ["onAnimationStart", "onAnimationEnd", "onAnimationIteration"];
|
|
80
80
|
declare const hdlClipboard: readonly ["onCopy", "onCut", "onPaste"];
|
|
81
81
|
declare const hdlComposition: readonly ["onCompositionEnd", "onCompositionStart", "onCompositionUpdate"];
|
|
@@ -103,20 +103,6 @@ declare const isFragmentSyntax: (node: TSESTree.Node | null | undefined) => node
|
|
|
103
103
|
* @param fragment
|
|
104
104
|
*/
|
|
105
105
|
declare function isFragmentElement(node: TSESTree.JSXElement, pragma: string, fragment: string): boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Check if a JSXElement or JSXFragment has only one literal child and is not a child
|
|
108
|
-
* @param node The AST node to check
|
|
109
|
-
* @returns `true` if the node has only one literal child and is not a child
|
|
110
|
-
* @example Somehow fragment like this is useful: <Foo content={<>ee eeee eeee ...</>} />
|
|
111
|
-
*/
|
|
112
|
-
declare function isFragmentWithOnlyTextAndIsNotChild(node: TSESTree.JSXElement | TSESTree.JSXFragment): boolean;
|
|
113
|
-
/**
|
|
114
|
-
* Check if a JSXElement or JSXFragment has less than two non-padding children and the first child is not a call expression
|
|
115
|
-
* @param node The AST node to check
|
|
116
|
-
* @returns boolean
|
|
117
|
-
*/
|
|
118
|
-
declare function isFragmentHasLessThanTwoChildren(node: TSESTree.JSXElement | TSESTree.JSXFragment): boolean;
|
|
119
|
-
declare function isFragmentWithSingleExpression(node: TSESTree.JSXElement | TSESTree.JSXFragment): boolean;
|
|
120
106
|
|
|
121
107
|
/**
|
|
122
108
|
* Check if function is returning JSX
|
|
@@ -246,4 +232,4 @@ declare const defaultJSXValueCheckHint: bigint;
|
|
|
246
232
|
*/
|
|
247
233
|
declare function isJSXValue(node: TSESTree$1.Node | null | undefined, context: RuleContext, hint?: bigint): boolean;
|
|
248
234
|
|
|
249
|
-
export { type CallFromPragmaPredicate, JSXValueCheckHint, defaultJSXValueCheckHint, elementType, findPropInAttributes, findPropInProperties, getFragmentFromContext, getPragmaFromContext, getProp, getPropName, getPropValue, hasAnyProp, hasChildren, hasEveryProp, hasProp, hdlAnimation, hdlClipboard, hdlComposition, hdlFocus, hdlForm, hdlImage, hdlKeyboard, hdlMedia, hdlMouse, hdlScroll, hdlSelection, hdlTouch, hdlTransition, hdlWheel, isCallFromPragma, isChildOfJSXElement, isChildrenOfCreateElement, isCloneElementCall, isCreateElementCall, isFragment, isFragmentElement,
|
|
235
|
+
export { type CallFromPragmaPredicate, JSXValueCheckHint, defaultJSXValueCheckHint, elementType, findPropInAttributes, findPropInProperties, getFragmentFromContext, getPragmaFromContext, getProp, getPropName, getPropValue, hasAnyProp, hasChildren, hasEveryProp, hasProp, hdlAnimation, hdlClipboard, hdlComposition, hdlFocus, hdlForm, hdlImage, hdlKeyboard, hdlMedia, hdlMouse, hdlScroll, hdlSelection, hdlTouch, hdlTransition, hdlWheel, isCallFromPragma, isChildOfJSXElement, isChildrenOfCreateElement, isCloneElementCall, isCreateElementCall, isFragment, isFragmentElement, isFragmentSyntax, isFunctionReturningJSXValue, isInitializedFromPragma, isInsideCreateElementProps, isInsidePropValue, isJSXElementOfBuiltinComponent, isJSXElementOfUserDefinedComponent, isJSXValue, isLineBreak, isLiteral, isPaddingSpaces, isPropertyOfPragma, isWhiteSpace, traverseUpProp };
|