@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.
Files changed (51) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.d.mts +26 -31
  3. package/dist/index.d.ts +26 -31
  4. package/dist/index.js +2 -2
  5. package/dist/index.mjs +2 -2
  6. package/node_modules/@eslint-react/ast/dist/index.cjs +129 -149
  7. package/node_modules/@eslint-react/ast/dist/index.d.mts +52 -60
  8. package/node_modules/@eslint-react/ast/dist/index.d.ts +52 -60
  9. package/node_modules/@eslint-react/ast/dist/index.js +129 -149
  10. package/node_modules/@eslint-react/ast/dist/index.mjs +131 -150
  11. package/node_modules/@eslint-react/ast/package.json +5 -5
  12. package/node_modules/@eslint-react/tools/package.json +2 -2
  13. package/node_modules/@eslint-react/types/package.json +4 -4
  14. package/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts +2 -2
  15. package/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts.map +1 -1
  16. package/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js.map +1 -1
  17. package/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts +2 -2
  18. package/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts.map +1 -1
  19. package/node_modules/@typescript-eslint/scope-manager/dist/assert.js.map +1 -1
  20. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts.map +1 -1
  21. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js +1 -0
  22. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js.map +1 -1
  23. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts.map +1 -1
  24. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js +2 -12
  25. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js.map +1 -1
  26. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js.map +1 -1
  27. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts.map +1 -1
  28. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js +2 -2
  29. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js.map +1 -1
  30. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js.map +1 -1
  31. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js.map +1 -1
  32. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js +1 -1
  33. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js.map +1 -1
  34. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js.map +1 -1
  35. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js.map +1 -1
  36. package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js.map +1 -1
  37. package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js.map +1 -1
  38. package/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js +1 -1
  39. package/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js.map +1 -1
  40. package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts.map +1 -1
  41. package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js +4 -11
  42. package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js.map +1 -1
  43. package/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js.map +1 -1
  44. package/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js.map +1 -1
  45. package/node_modules/@typescript-eslint/scope-manager/package.json +5 -5
  46. package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts +57 -8
  47. package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map +1 -1
  48. package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts +4 -2
  49. package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map +1 -1
  50. package/node_modules/@typescript-eslint/types/package.json +2 -2
  51. 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
- * @param attributes The attributes to search in
134
- * @param context The rule context
135
- * @returns A function that searches for a property in the given attributes
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 findPropInProperties(properties: (TSESTree.Property | TSESTree.RestElement | TSESTree.SpreadElement)[] | TSESTree.ObjectLiteralElement[], context: RuleContext, seenProps?: string[]): (propName: string) => O.Option<(typeof properties)[number]>;
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
- * Get the name of a JSX attribute with namespace
162
- * @param node The JSX attribute node
163
- * @returns string
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 getPropName(node: TSESTree.JSXAttribute): string;
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
- * @param attributes The attributes to search in
134
- * @param context The rule context
135
- * @returns A function that searches for a property in the given attributes
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 findPropInProperties(properties: (TSESTree.Property | TSESTree.RestElement | TSESTree.SpreadElement)[] | TSESTree.ObjectLiteralElement[], context: RuleContext, seenProps?: string[]): (propName: string) => O.Option<(typeof properties)[number]>;
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
- * Get the name of a JSX attribute with namespace
162
- * @param node The JSX attribute node
163
- * @returns string
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 getPropName(node: TSESTree.JSXAttribute): string;
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