Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions packages/core/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
- [ComponentKind](type-aliases/ComponentKind.md)
- [ComponentLifecyclePhaseKind](type-aliases/ComponentLifecyclePhaseKind.md)
- [ComponentPhaseKind](type-aliases/ComponentPhaseKind.md)
- [ComponentStateKind](type-aliases/ComponentStateKind.md)
- [JsxAttributeValue](type-aliases/JsxAttributeValue.md)
- [JsxDetectionHint](type-aliases/JsxDetectionHint.md)

Expand Down Expand Up @@ -118,8 +117,6 @@
- [getJsxElementType](functions/getJsxElementType.md)
- [getPhaseKindOfFunction](functions/getPhaseKindOfFunction.md)
- [hasNoneOrLooseComponentName](functions/hasNoneOrLooseComponentName.md)
- [isAssignmentToThisState](functions/isAssignmentToThisState.md)
- [isChildrenOfCreateElement](functions/isChildrenOfCreateElement.md)
- [isClassComponent](functions/isClassComponent.md)
- [isComponentDefinition](functions/isComponentDefinition.md)
- [isComponentName](functions/isComponentName.md)
Expand All @@ -129,7 +126,6 @@
- [isDeclaredInRenderPropLoose](functions/isDeclaredInRenderPropLoose.md)
- [isFunctionOfComponentDidMount](functions/isFunctionOfComponentDidMount.md)
- [isFunctionOfComponentWillUnmount](functions/isFunctionOfComponentWillUnmount.md)
- [isFunctionOfRenderMethod](functions/isFunctionOfRenderMethod.md)
- [isFunctionOfUseEffectCleanup](functions/isFunctionOfUseEffectCleanup.md)
- [isFunctionOfUseEffectSetup](functions/isFunctionOfUseEffectSetup.md)
- [isInitializedFromReact](functions/isInitializedFromReact.md)
Expand All @@ -149,7 +145,6 @@
- [isRenderFunctionLoose](functions/isRenderFunctionLoose.md)
- [isRenderMethodLike](functions/isRenderMethodLike.md)
- [isRenderPropLoose](functions/isRenderPropLoose.md)
- [isThisSetState](functions/isThisSetState.md)
- [isUseEffectLikeCall](functions/isUseEffectLikeCall.md)
- [resolveJsxAttributeValue](functions/resolveJsxAttributeValue.md)
- [stringifyJsx](functions/stringifyJsx.md)
Expand Down
8 changes: 5 additions & 3 deletions packages/core/docs/functions/getComponentNameFromId.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
function getComponentNameFromId(id: Identifier | Identifier[] | undefined): string | undefined;
```

Get component name from an identifier or identifier sequence (e.g., MemberExpression)

## Parameters

| Parameter | Type |
| ------ | ------ |
| `id` | `Identifier` \| `Identifier`[] \| `undefined` |
| Parameter | Type | Description |
| ------ | ------ | ------ |
| `id` | `Identifier` \| `Identifier`[] \| `undefined` | The identifier or identifier sequence |

## Returns

Expand Down
10 changes: 6 additions & 4 deletions packages/core/docs/functions/hasNoneOrLooseComponentName.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
function hasNoneOrLooseComponentName(context: RuleContext, fn: TSESTreeFunction): boolean;
```

Check if the function has no name or a loose component name

## Parameters

| Parameter | Type |
| ------ | ------ |
| `context` | `RuleContext` |
| `fn` | `TSESTreeFunction` |
| Parameter | Type | Description |
| ------ | ------ | ------ |
| `context` | `RuleContext` | The rule context |
| `fn` | `TSESTreeFunction` | The function node |

## Returns

Expand Down
17 changes: 0 additions & 17 deletions packages/core/docs/functions/isAssignmentToThisState.md

This file was deleted.

22 changes: 0 additions & 22 deletions packages/core/docs/functions/isChildrenOfCreateElement.md

This file was deleted.

6 changes: 3 additions & 3 deletions packages/core/docs/functions/isComponentDefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Determines if a function node represents a valid React component definition
| Parameter | Type | Description |
| ------ | ------ | ------ |
| `context` | `RuleContext` | The rule context |
| `node` | `TSESTreeFunction` | The function node to check |
| `hint` | `bigint` | Component detection hints as bit flags |
| `node` | `TSESTreeFunction` | The function node to analyze |
| `hint` | `bigint` | Component detection hints (bit flags) to customize detection logic |

## Returns

`boolean`

`true` if the node is a valid component definition, `false` otherwise
`true` if the node is considered a component definition
8 changes: 5 additions & 3 deletions packages/core/docs/functions/isComponentName.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
function isComponentName(name: string): boolean;
```

Check if a string matches the strict component name pattern

## Parameters

| Parameter | Type |
| ------ | ------ |
| `name` | `string` |
| Parameter | Type | Description |
| ------ | ------ | ------ |
| `name` | `string` | The name to check |

## Returns

Expand Down
8 changes: 5 additions & 3 deletions packages/core/docs/functions/isComponentNameLoose.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
function isComponentNameLoose(name: string): boolean;
```

Check if a string matches the loose component name pattern

## Parameters

| Parameter | Type |
| ------ | ------ |
| `name` | `string` |
| Parameter | Type | Description |
| ------ | ------ | ------ |
| `name` | `string` | The name to check |

## Returns

Expand Down
30 changes: 0 additions & 30 deletions packages/core/docs/functions/isFunctionOfRenderMethod.md

This file was deleted.

17 changes: 0 additions & 17 deletions packages/core/docs/functions/isThisSetState.md

This file was deleted.

8 changes: 4 additions & 4 deletions packages/core/docs/functions/stringifyJsx.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

```ts
function stringifyJsx(node:
| JSXClosingElement
| JSXClosingFragment
| JSXIdentifier
| JSXMemberExpression
| JSXNamespacedName
| JSXMemberExpression
| JSXOpeningElement
| JSXClosingElement
| JSXOpeningFragment
| JSXClosingFragment
| JSXText): string;
```

Expand All @@ -20,7 +20,7 @@ Incomplete but sufficient stringification of JSX nodes for common use cases

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `node` | \| `JSXClosingElement` \| `JSXClosingFragment` \| `JSXIdentifier` \| `JSXMemberExpression` \| `JSXNamespacedName` \| `JSXOpeningElement` \| `JSXOpeningFragment` \| `JSXText` | JSX node from TypeScript ESTree |
| `node` | \| `JSXIdentifier` \| `JSXNamespacedName` \| `JSXMemberExpression` \| `JSXOpeningElement` \| `JSXClosingElement` \| `JSXOpeningFragment` \| `JSXClosingFragment` \| `JSXText` | JSX node from TypeScript ESTree |

## Returns

Expand Down
24 changes: 13 additions & 11 deletions packages/core/docs/interfaces/ClassComponent.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

# Interface: ClassComponent

Represents a React class component

## Extends

- [`SemanticNode`](SemanticNode.md)

## Properties

| Property | Type | Overrides | Inherited from |
| ------ | ------ | ------ | ------ |
| <a id="displayname"></a> `displayName` | `Expression` \| `undefined` | - | - |
| <a id="flag"></a> `flag` | `bigint` | [`SemanticNode`](SemanticNode.md).[`flag`](SemanticNode.md#flag) | - |
| <a id="hint"></a> `hint` | `bigint` | [`SemanticNode`](SemanticNode.md).[`hint`](SemanticNode.md#hint) | - |
| <a id="id"></a> `id` | `Identifier` \| `undefined` | [`SemanticNode`](SemanticNode.md).[`id`](SemanticNode.md#id) | - |
| <a id="key"></a> `key` | `string` | - | [`SemanticNode`](SemanticNode.md).[`key`](SemanticNode.md#key) |
| <a id="kind"></a> `kind` | `"class"` | [`SemanticNode`](SemanticNode.md).[`kind`](SemanticNode.md#kind) | - |
| <a id="methods"></a> `methods` | `TSESTreeMethodOrProperty`[] | - | - |
| <a id="name"></a> `name` | `string` \| `undefined` | - | [`SemanticNode`](SemanticNode.md).[`name`](SemanticNode.md#name) |
| <a id="node"></a> `node` | `TSESTreeClass` | [`SemanticNode`](SemanticNode.md).[`node`](SemanticNode.md#node) | - |
| Property | Type | Description | Overrides | Inherited from |
| ------ | ------ | ------ | ------ | ------ |
| <a id="displayname"></a> `displayName` | `Expression` \| `undefined` | The display name of the component | - | - |
| <a id="flag"></a> `flag` | `bigint` | Flags describing the component's characteristics | [`SemanticNode`](SemanticNode.md).[`flag`](SemanticNode.md#flag) | - |
| <a id="hint"></a> `hint` | `bigint` | Hint for how the component was detected | [`SemanticNode`](SemanticNode.md).[`hint`](SemanticNode.md#hint) | - |
| <a id="id"></a> `id` | `Identifier` \| `undefined` | The identifier of the component | [`SemanticNode`](SemanticNode.md).[`id`](SemanticNode.md#id) | - |
| <a id="key"></a> `key` | `string` | - | - | [`SemanticNode`](SemanticNode.md).[`key`](SemanticNode.md#key) |
| <a id="kind"></a> `kind` | `"class"` | The kind of component | [`SemanticNode`](SemanticNode.md).[`kind`](SemanticNode.md#kind) | - |
| <a id="methods"></a> `methods` | `TSESTreeMethodOrProperty`[] | List of methods and properties in the class | - | - |
| <a id="name"></a> `name` | `string` \| `undefined` | - | - | [`SemanticNode`](SemanticNode.md).[`name`](SemanticNode.md#name) |
| <a id="node"></a> `node` | `TSESTreeClass` | The AST node of the class | [`SemanticNode`](SemanticNode.md).[`node`](SemanticNode.md#node) | - |
26 changes: 14 additions & 12 deletions packages/core/docs/interfaces/FunctionComponent.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@

# Interface: FunctionComponent

Represents a React function component

## Extends

- [`SemanticNode`](SemanticNode.md)

## Properties

| Property | Type | Overrides | Inherited from |
| ------ | ------ | ------ | ------ |
| <a id="displayname"></a> `displayName` | `Expression` \| `undefined` | - | - |
| <a id="flag"></a> `flag` | `bigint` | [`SemanticNode`](SemanticNode.md).[`flag`](SemanticNode.md#flag) | - |
| <a id="hint"></a> `hint` | `bigint` | [`SemanticNode`](SemanticNode.md).[`hint`](SemanticNode.md#hint) | - |
| <a id="hookcalls"></a> `hookCalls` | `CallExpression`[] | - | - |
| <a id="id"></a> `id` | `Identifier` \| `Identifier`[] \| `undefined` | [`SemanticNode`](SemanticNode.md).[`id`](SemanticNode.md#id) | - |
| <a id="initpath"></a> `initPath` | `FunctionInitPath` \| `undefined` | - | - |
| <a id="key"></a> `key` | `string` | - | [`SemanticNode`](SemanticNode.md).[`key`](SemanticNode.md#key) |
| <a id="kind"></a> `kind` | `"function"` | [`SemanticNode`](SemanticNode.md).[`kind`](SemanticNode.md#kind) | - |
| <a id="name"></a> `name` | `string` \| `undefined` | - | [`SemanticNode`](SemanticNode.md).[`name`](SemanticNode.md#name) |
| <a id="node"></a> `node` | `TSESTreeFunction` | [`SemanticNode`](SemanticNode.md).[`node`](SemanticNode.md#node) | - |
| Property | Type | Description | Overrides | Inherited from |
| ------ | ------ | ------ | ------ | ------ |
| <a id="displayname"></a> `displayName` | `Expression` \| `undefined` | The display name of the component | - | - |
| <a id="flag"></a> `flag` | `bigint` | Flags describing the component's characteristics | [`SemanticNode`](SemanticNode.md).[`flag`](SemanticNode.md#flag) | - |
| <a id="hint"></a> `hint` | `bigint` | Hint for how the component was detected | [`SemanticNode`](SemanticNode.md).[`hint`](SemanticNode.md#hint) | - |
| <a id="hookcalls"></a> `hookCalls` | `CallExpression`[] | List of hook calls within the component | - | - |
| <a id="id"></a> `id` | `Identifier` \| `Identifier`[] \| `undefined` | The identifier or identifier sequence of the component | [`SemanticNode`](SemanticNode.md).[`id`](SemanticNode.md#id) | - |
| <a id="initpath"></a> `initPath` | `FunctionInitPath` \| `undefined` | The initialization path of the function | - | - |
| <a id="key"></a> `key` | `string` | - | - | [`SemanticNode`](SemanticNode.md).[`key`](SemanticNode.md#key) |
| <a id="kind"></a> `kind` | `"function"` | The kind of component | [`SemanticNode`](SemanticNode.md).[`kind`](SemanticNode.md#kind) | - |
| <a id="name"></a> `name` | `string` \| `undefined` | - | - | [`SemanticNode`](SemanticNode.md).[`name`](SemanticNode.md#name) |
| <a id="node"></a> `node` | `TSESTreeFunction` | The AST node of the function | [`SemanticNode`](SemanticNode.md).[`node`](SemanticNode.md#node) | - |
2 changes: 2 additions & 0 deletions packages/core/docs/type-aliases/Component.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ type Component =
| ClassComponent
| FunctionComponent;
```

Union type representing either a class or function component
7 changes: 0 additions & 7 deletions packages/core/docs/type-aliases/ComponentStateKind.md

This file was deleted.

16 changes: 8 additions & 8 deletions packages/core/docs/variables/ComponentFlag.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ ComponentFlag: {

## Type Declaration

| Name | Type | Default value |
| ------ | ------ | ------ |
| <a id="async"></a> `Async` | `bigint` | - |
| <a id="createelement"></a> `CreateElement` | `bigint` | - |
| <a id="forwardref"></a> `ForwardRef` | `bigint` | - |
| <a id="memo"></a> `Memo` | `bigint` | - |
| <a id="none"></a> `None` | `bigint` | `0n` |
| <a id="purecomponent"></a> `PureComponent` | `bigint` | - |
| Name | Type | Default value | Description |
| ------ | ------ | ------ | ------ |
| <a id="async"></a> `Async` | `bigint` | - | Indicates the component is asynchronous |
| <a id="createelement"></a> `CreateElement` | `bigint` | - | Indicates the component creates elements using `createElement` instead of JSX |
| <a id="forwardref"></a> `ForwardRef` | `bigint` | - | Indicates the component forwards a ref (e.g. React.forwardRef) |
| <a id="memo"></a> `Memo` | `bigint` | - | Indicates the component is memoized (e.g. React.memo) |
| <a id="none"></a> `None` | `bigint` | `0n` | No flags set |
| <a id="purecomponent"></a> `PureComponent` | `bigint` | - | Indicates the component is a pure component (e.g. extends PureComponent) |
19 changes: 0 additions & 19 deletions packages/core/src/component/component-children.ts

This file was deleted.

Loading