@eslint-react/jsx 0.8.8-beta.2 → 0.8.8-beta.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.cjs +2 -2
- package/dist/index.d.mts +26 -31
- package/dist/index.d.ts +26 -31
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/node_modules/@eslint-react/ast/dist/index.cjs +129 -149
- package/node_modules/@eslint-react/ast/dist/index.d.mts +52 -60
- package/node_modules/@eslint-react/ast/dist/index.d.ts +52 -60
- package/node_modules/@eslint-react/ast/dist/index.js +129 -149
- package/node_modules/@eslint-react/ast/dist/index.mjs +131 -150
- package/node_modules/@eslint-react/ast/package.json +5 -5
- package/node_modules/@eslint-react/tools/package.json +2 -2
- package/node_modules/@eslint-react/types/package.json +4 -4
- package/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts +2 -2
- package/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts +2 -2
- package/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/assert.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js +2 -12
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js +2 -2
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js +4 -11
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/package.json +5 -5
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts +57 -8
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts +4 -2
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/package.json +2 -2
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { TSESTree } from '@typescript-eslint/types';
|
|
2
1
|
import { RuleContext } from '@eslint-react/types';
|
|
2
|
+
import { TSESTree } from '@typescript-eslint/types';
|
|
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
|
+
* Determines whether inside createElement's props.
|
|
9
|
+
* @param node The AST node to check
|
|
10
|
+
* @param context The rule context
|
|
11
|
+
* @returns `true` if the node is inside createElement's props
|
|
12
|
+
*/
|
|
13
|
+
declare function isInsideCreateElementProps(node: TSESTree.Node, context: RuleContext): boolean;
|
|
14
|
+
declare function isChildrenOfCreateElement(node: TSESTree.Node, context: RuleContext): boolean;
|
|
7
15
|
/**
|
|
8
16
|
* Check if a `JSXElement` or `JSXFragment` has children
|
|
9
17
|
* @param node The AST node to check
|
|
@@ -20,8 +28,6 @@ declare function isChildOfJSXElement(node: TSESTree.Node): node is TSESTree.JSXE
|
|
|
20
28
|
parent: TSESTree.JSXElement;
|
|
21
29
|
};
|
|
22
30
|
|
|
23
|
-
declare function isChildrenOfCreateElement(node: TSESTree.Node, context: RuleContext): boolean;
|
|
24
|
-
|
|
25
31
|
/**
|
|
26
32
|
* Check if a node is a `JSXElement` of `User-Defined Component` type
|
|
27
33
|
* @param node The AST node to check
|
|
@@ -63,14 +69,6 @@ declare const isCreateElementCall: CallFromPragmaPredicate;
|
|
|
63
69
|
*/
|
|
64
70
|
declare const isCloneElementCall: CallFromPragmaPredicate;
|
|
65
71
|
|
|
66
|
-
/**
|
|
67
|
-
* Determines whether inside createElement's props.
|
|
68
|
-
* @param node The AST node to check
|
|
69
|
-
* @param context The rule context
|
|
70
|
-
* @returns `true` if the node is inside createElement's props
|
|
71
|
-
*/
|
|
72
|
-
declare function isInsideCreateElementProps(node: TSESTree.Node, context: RuleContext): boolean;
|
|
73
|
-
|
|
74
72
|
/**
|
|
75
73
|
* Returns the tag name associated with a JSXOpeningElement.
|
|
76
74
|
* @param node The visited JSXOpeningElement node object.
|
|
@@ -130,39 +128,36 @@ declare function isFragmentWithSingleExpression(node: TSESTree.JSXElement | TSES
|
|
|
130
128
|
declare function isFunctionReturningJSXValue(node: TSESTreeFunction, context: RuleContext, hint?: bigint): boolean;
|
|
131
129
|
|
|
132
130
|
/**
|
|
133
|
-
*
|
|
134
|
-
* @param
|
|
135
|
-
* @returns
|
|
136
|
-
*/
|
|
137
|
-
declare function findPropInAttributes(attributes: (TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute)[], context: RuleContext): (propName: string) => O.Option<NonNullable<TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute | undefined>>;
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* @param properties The properties to search in
|
|
141
|
-
* @param context The rule context
|
|
142
|
-
* @param seenProps The properties that have already been seen
|
|
143
|
-
* @returns A function that searches for a property in the given properties
|
|
131
|
+
* Get the name of a JSX attribute with namespace
|
|
132
|
+
* @param node The JSX attribute node
|
|
133
|
+
* @returns string
|
|
144
134
|
*/
|
|
145
|
-
declare function
|
|
146
|
-
|
|
147
|
-
declare function getProp(props: (TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute)[], propName: string, context: RuleContext): O.Option<TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute>;
|
|
135
|
+
declare function getPropName(node: TSESTree$1.JSXAttribute): string;
|
|
136
|
+
declare function getProp(props: (TSESTree$1.JSXAttribute | TSESTree$1.JSXSpreadAttribute)[], propName: string, context: RuleContext): O.Option<TSESTree$1.JSXAttribute | TSESTree$1.JSXSpreadAttribute>;
|
|
148
137
|
/**
|
|
149
138
|
* Gets and resolves the static value of a JSX attribute
|
|
150
139
|
* @param attribute The JSX attribute to get the value of
|
|
151
140
|
* @param context The rule context
|
|
152
141
|
* @returns The static value of the given JSX attribute
|
|
153
142
|
*/
|
|
154
|
-
declare function getPropValue(attribute: TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute, context: RuleContext): O.None<{
|
|
143
|
+
declare function getPropValue(attribute: TSESTree$1.JSXAttribute | TSESTree$1.JSXSpreadAttribute, context: RuleContext): O.None<{
|
|
155
144
|
value: unknown;
|
|
156
145
|
} | null> | O.Some<{
|
|
157
146
|
value: unknown;
|
|
158
147
|
} | null>;
|
|
159
|
-
|
|
160
148
|
/**
|
|
161
|
-
*
|
|
162
|
-
* @param
|
|
163
|
-
* @
|
|
149
|
+
* @param properties The properties to search in
|
|
150
|
+
* @param context The rule context
|
|
151
|
+
* @param seenProps The properties that have already been seen
|
|
152
|
+
* @returns A function that searches for a property in the given properties
|
|
153
|
+
*/
|
|
154
|
+
declare function findPropInProperties(properties: (TSESTree$1.Property | TSESTree$1.RestElement | TSESTree$1.SpreadElement)[] | TSESTree$1.ObjectLiteralElement[], context: RuleContext, seenProps?: string[]): (propName: string) => O.Option<(typeof properties)[number]>;
|
|
155
|
+
/**
|
|
156
|
+
* @param attributes The attributes to search in
|
|
157
|
+
* @param context The rule context
|
|
158
|
+
* @returns A function that searches for a property in the given attributes
|
|
164
159
|
*/
|
|
165
|
-
declare function
|
|
160
|
+
declare function findPropInAttributes(attributes: (TSESTree$1.JSXAttribute | TSESTree$1.JSXSpreadAttribute)[], context: RuleContext): (propName: string) => O.Option<NonNullable<TSESTree$1.JSXAttribute | TSESTree$1.JSXSpreadAttribute | undefined>>;
|
|
166
161
|
|
|
167
162
|
/**
|
|
168
163
|
* Check if the given prop name is present in the given attributes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { TSESTree } from '@typescript-eslint/types';
|
|
2
1
|
import { RuleContext } from '@eslint-react/types';
|
|
2
|
+
import { TSESTree } from '@typescript-eslint/types';
|
|
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
|
+
* Determines whether inside createElement's props.
|
|
9
|
+
* @param node The AST node to check
|
|
10
|
+
* @param context The rule context
|
|
11
|
+
* @returns `true` if the node is inside createElement's props
|
|
12
|
+
*/
|
|
13
|
+
declare function isInsideCreateElementProps(node: TSESTree.Node, context: RuleContext): boolean;
|
|
14
|
+
declare function isChildrenOfCreateElement(node: TSESTree.Node, context: RuleContext): boolean;
|
|
7
15
|
/**
|
|
8
16
|
* Check if a `JSXElement` or `JSXFragment` has children
|
|
9
17
|
* @param node The AST node to check
|
|
@@ -20,8 +28,6 @@ declare function isChildOfJSXElement(node: TSESTree.Node): node is TSESTree.JSXE
|
|
|
20
28
|
parent: TSESTree.JSXElement;
|
|
21
29
|
};
|
|
22
30
|
|
|
23
|
-
declare function isChildrenOfCreateElement(node: TSESTree.Node, context: RuleContext): boolean;
|
|
24
|
-
|
|
25
31
|
/**
|
|
26
32
|
* Check if a node is a `JSXElement` of `User-Defined Component` type
|
|
27
33
|
* @param node The AST node to check
|
|
@@ -63,14 +69,6 @@ declare const isCreateElementCall: CallFromPragmaPredicate;
|
|
|
63
69
|
*/
|
|
64
70
|
declare const isCloneElementCall: CallFromPragmaPredicate;
|
|
65
71
|
|
|
66
|
-
/**
|
|
67
|
-
* Determines whether inside createElement's props.
|
|
68
|
-
* @param node The AST node to check
|
|
69
|
-
* @param context The rule context
|
|
70
|
-
* @returns `true` if the node is inside createElement's props
|
|
71
|
-
*/
|
|
72
|
-
declare function isInsideCreateElementProps(node: TSESTree.Node, context: RuleContext): boolean;
|
|
73
|
-
|
|
74
72
|
/**
|
|
75
73
|
* Returns the tag name associated with a JSXOpeningElement.
|
|
76
74
|
* @param node The visited JSXOpeningElement node object.
|
|
@@ -130,39 +128,36 @@ declare function isFragmentWithSingleExpression(node: TSESTree.JSXElement | TSES
|
|
|
130
128
|
declare function isFunctionReturningJSXValue(node: TSESTreeFunction, context: RuleContext, hint?: bigint): boolean;
|
|
131
129
|
|
|
132
130
|
/**
|
|
133
|
-
*
|
|
134
|
-
* @param
|
|
135
|
-
* @returns
|
|
136
|
-
*/
|
|
137
|
-
declare function findPropInAttributes(attributes: (TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute)[], context: RuleContext): (propName: string) => O.Option<NonNullable<TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute | undefined>>;
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* @param properties The properties to search in
|
|
141
|
-
* @param context The rule context
|
|
142
|
-
* @param seenProps The properties that have already been seen
|
|
143
|
-
* @returns A function that searches for a property in the given properties
|
|
131
|
+
* Get the name of a JSX attribute with namespace
|
|
132
|
+
* @param node The JSX attribute node
|
|
133
|
+
* @returns string
|
|
144
134
|
*/
|
|
145
|
-
declare function
|
|
146
|
-
|
|
147
|
-
declare function getProp(props: (TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute)[], propName: string, context: RuleContext): O.Option<TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute>;
|
|
135
|
+
declare function getPropName(node: TSESTree$1.JSXAttribute): string;
|
|
136
|
+
declare function getProp(props: (TSESTree$1.JSXAttribute | TSESTree$1.JSXSpreadAttribute)[], propName: string, context: RuleContext): O.Option<TSESTree$1.JSXAttribute | TSESTree$1.JSXSpreadAttribute>;
|
|
148
137
|
/**
|
|
149
138
|
* Gets and resolves the static value of a JSX attribute
|
|
150
139
|
* @param attribute The JSX attribute to get the value of
|
|
151
140
|
* @param context The rule context
|
|
152
141
|
* @returns The static value of the given JSX attribute
|
|
153
142
|
*/
|
|
154
|
-
declare function getPropValue(attribute: TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute, context: RuleContext): O.None<{
|
|
143
|
+
declare function getPropValue(attribute: TSESTree$1.JSXAttribute | TSESTree$1.JSXSpreadAttribute, context: RuleContext): O.None<{
|
|
155
144
|
value: unknown;
|
|
156
145
|
} | null> | O.Some<{
|
|
157
146
|
value: unknown;
|
|
158
147
|
} | null>;
|
|
159
|
-
|
|
160
148
|
/**
|
|
161
|
-
*
|
|
162
|
-
* @param
|
|
163
|
-
* @
|
|
149
|
+
* @param properties The properties to search in
|
|
150
|
+
* @param context The rule context
|
|
151
|
+
* @param seenProps The properties that have already been seen
|
|
152
|
+
* @returns A function that searches for a property in the given properties
|
|
153
|
+
*/
|
|
154
|
+
declare function findPropInProperties(properties: (TSESTree$1.Property | TSESTree$1.RestElement | TSESTree$1.SpreadElement)[] | TSESTree$1.ObjectLiteralElement[], context: RuleContext, seenProps?: string[]): (propName: string) => O.Option<(typeof properties)[number]>;
|
|
155
|
+
/**
|
|
156
|
+
* @param attributes The attributes to search in
|
|
157
|
+
* @param context The rule context
|
|
158
|
+
* @returns A function that searches for a property in the given attributes
|
|
164
159
|
*/
|
|
165
|
-
declare function
|
|
160
|
+
declare function findPropInAttributes(attributes: (TSESTree$1.JSXAttribute | TSESTree$1.JSXSpreadAttribute)[], context: RuleContext): (propName: string) => O.Option<NonNullable<TSESTree$1.JSXAttribute | TSESTree$1.JSXSpreadAttribute | undefined>>;
|
|
166
161
|
|
|
167
162
|
/**
|
|
168
163
|
* Check if the given prop name is present in the given attributes
|