@eslint-react/core 2.8.2-next.0 → 2.8.2-next.2

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 CHANGED
@@ -174,7 +174,7 @@ interface FunctionComponentSemanticNode extends SemanticNode {
174
174
  /**
175
175
  * The kind of component
176
176
  */
177
- kind: "function";
177
+ kind: "function-component";
178
178
  /**
179
179
  * The AST node of the function
180
180
  */
@@ -227,7 +227,7 @@ interface ClassComponentSemanticNode extends SemanticNode {
227
227
  /**
228
228
  * The kind of component
229
229
  */
230
- kind: "class";
230
+ kind: "class-component";
231
231
  /**
232
232
  * The AST node of the class
233
233
  */
@@ -350,12 +350,6 @@ declare function isClassComponent(node: TSESTree.Node): node is ast.TSESTreeClas
350
350
  */
351
351
  declare function isPureComponent(node: TSESTree.Node): boolean;
352
352
  //#endregion
353
- //#region src/component/component-kind.d.ts
354
- /**
355
- * Represents the kind of a React component
356
- */
357
- type ComponentKind = "classComponent" | "functionComponent";
358
- //#endregion
359
353
  //#region src/component/component-method-callback.d.ts
360
354
  /**
361
355
  * Check if the given node is a componentDidMount callback
@@ -506,6 +500,12 @@ declare function isComponentWrapperCallback(context: RuleContext, node: TSESTree
506
500
  */
507
501
  declare function isComponentWrapperCallbackLoose(context: RuleContext, node: TSESTree.Node): boolean;
508
502
  //#endregion
503
+ //#region src/function/function-kind.d.ts
504
+ /**
505
+ * Represents the kind of a React function
506
+ */
507
+ type ComponentKind = "client-function" | "server-function";
508
+ //#endregion
509
509
  //#region src/function/function-semantic-node.d.ts
510
510
  /**
511
511
  * Represents a React Client Function
@@ -538,7 +538,7 @@ type FindEnclosingComponentOrHookFilter = (n: TSESTree.Node, name: string | null
538
538
  * @param test Optional test function to customize component or hook identification
539
539
  * @returns The enclosing component or hook node, or `null` if none is ASAST.
540
540
  */
541
- declare function findEnclosingComponentOrHook(node: TSESTree.Node | unit, test?: FindEnclosingComponentOrHookFilter): TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression | undefined;
541
+ declare function findEnclosingComponentOrHook(node: TSESTree.Node | unit, test?: FindEnclosingComponentOrHookFilter): TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | undefined;
542
542
  //#endregion
543
543
  //#region src/hierarchy/is-inside-component-or-hook.d.ts
544
544
  /**
@@ -725,7 +725,7 @@ declare function resolveJsxAttributeValue(context: RuleContext, attribute: ast.T
725
725
  readonly toStatic: () => string | number | bigint | boolean | RegExp | null;
726
726
  } | {
727
727
  readonly kind: "expression";
728
- readonly node: TSESTree.JSXEmptyExpression | TSESTree.Expression;
728
+ readonly node: TSESTree.Expression | TSESTree.JSXEmptyExpression;
729
729
  readonly toStatic: () => unknown;
730
730
  } | {
731
731
  readonly kind: "element";
@@ -733,7 +733,7 @@ declare function resolveJsxAttributeValue(context: RuleContext, attribute: ast.T
733
733
  readonly toStatic: () => undefined;
734
734
  } | {
735
735
  readonly kind: "spreadChild";
736
- readonly node: TSESTree.JSXEmptyExpression | TSESTree.Expression;
736
+ readonly node: TSESTree.Expression | TSESTree.JSXEmptyExpression;
737
737
  readonly toStatic: () => undefined;
738
738
  } | {
739
739
  readonly kind: "spreadProps";
package/dist/index.js CHANGED
@@ -954,7 +954,7 @@ function useComponentCollector(context, options = {}) {
954
954
  const entry = {
955
955
  id: getFunctionComponentId(context, node),
956
956
  key,
957
- kind: "function",
957
+ kind: "function-component",
958
958
  name,
959
959
  node,
960
960
  directives,
@@ -1050,7 +1050,7 @@ function useComponentCollectorLegacy(context) {
1050
1050
  components.set(key, {
1051
1051
  id,
1052
1052
  key,
1053
- kind: "class",
1053
+ kind: "class-component",
1054
1054
  name,
1055
1055
  node,
1056
1056
  displayName: unit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "2.8.2-next.0",
3
+ "version": "2.8.2-next.2",
4
4
  "description": "ESLint React's ESLint utility module for static analysis of React core APIs and patterns.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -34,10 +34,10 @@
34
34
  "@typescript-eslint/types": "^8.54.0",
35
35
  "@typescript-eslint/utils": "^8.54.0",
36
36
  "ts-pattern": "^5.9.0",
37
- "@eslint-react/ast": "2.8.2-next.0",
38
- "@eslint-react/eff": "2.8.2-next.0",
39
- "@eslint-react/var": "2.8.2-next.0",
40
- "@eslint-react/shared": "2.8.2-next.0"
37
+ "@eslint-react/ast": "2.8.2-next.2",
38
+ "@eslint-react/shared": "2.8.2-next.2",
39
+ "@eslint-react/eff": "2.8.2-next.2",
40
+ "@eslint-react/var": "2.8.2-next.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "tsdown": "^0.20.1",