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
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ type Options = {

| Property | Type |
| ------ | ------ |
| <a id="collectdisplayname"></a> `collectDisplayName?` | `boolean` |
| <a id="hint"></a> `hint?` | [`ComponentDetectionHint`](../../../../type-aliases/ComponentDetectionHint.md) |
| <a id="property-collectdisplayname"></a> `collectDisplayName?` | `boolean` |
| <a id="property-hint"></a> `hint?` | [`ComponentDetectionHint`](../../../../type-aliases/ComponentDetectionHint.md) |
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ type ReturnType = {

| Property | Type |
| ------ | ------ |
| <a id="ctx"></a> `ctx` | \{ `getAllComponents`: (`node`: `TSESTree.Program`) => [`FunctionComponentSemanticNode`](../../../../interfaces/FunctionComponentSemanticNode.md)[]; `getCurrentEntries`: () => `FunctionEntry`[]; `getCurrentEntry`: () => `FunctionEntry` \| `unit`; \} |
| <a id="property-ctx"></a> `ctx` | \{ `getAllComponents`: (`node`: `TSESTree.Program`) => [`FunctionComponentSemanticNode`](../../../../interfaces/FunctionComponentSemanticNode.md)[]; `getCurrentEntries`: () => `FunctionEntry`[]; `getCurrentEntry`: () => `FunctionEntry` \| `unit`; \} |
| `ctx.getAllComponents` | (`node`: `TSESTree.Program`) => [`FunctionComponentSemanticNode`](../../../../interfaces/FunctionComponentSemanticNode.md)[] |
| `ctx.getCurrentEntries` | () => `FunctionEntry`[] |
| `ctx.getCurrentEntry` | () => `FunctionEntry` \| `unit` |
| <a id="visitor"></a> `visitor` | `ESLintUtils.RuleListener` |
| <a id="property-visitor"></a> `visitor` | `ESLintUtils.RuleListener` |
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ type ReturnType = {

| Property | Type |
| ------ | ------ |
| <a id="ctx"></a> `ctx` | \{ `getAllComponents`: (`node`: `TSESTree.Program`) => [`ClassComponentSemanticNode`](../../../../interfaces/ClassComponentSemanticNode.md)[]; \} |
| <a id="property-ctx"></a> `ctx` | \{ `getAllComponents`: (`node`: `TSESTree.Program`) => [`ClassComponentSemanticNode`](../../../../interfaces/ClassComponentSemanticNode.md)[]; \} |
| `ctx.getAllComponents` | (`node`: `TSESTree.Program`) => [`ClassComponentSemanticNode`](../../../../interfaces/ClassComponentSemanticNode.md)[] |
| <a id="visitor"></a> `visitor` | `ESLintUtils.RuleListener` |
| <a id="property-visitor"></a> `visitor` | `ESLintUtils.RuleListener` |
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ type ReturnType = {

| Property | Type |
| ------ | ------ |
| <a id="ctx"></a> `ctx` | \{ `getAllHooks`: [`HookSemanticNode`](../../../../interfaces/HookSemanticNode.md)[]; `getCurrentEntries`: `FunctionEntry`[]; `getCurrentEntry`: `FunctionEntry` \| `undefined`; \} |
| <a id="property-ctx"></a> `ctx` | \{ `getAllHooks`: [`HookSemanticNode`](../../../../interfaces/HookSemanticNode.md)[]; `getCurrentEntries`: `FunctionEntry`[]; `getCurrentEntry`: `FunctionEntry` \| `undefined`; \} |
| `ctx.getAllHooks` | [`HookSemanticNode`](../../../../interfaces/HookSemanticNode.md)[] |
| `ctx.getCurrentEntries` | `FunctionEntry`[] |
| `ctx.getCurrentEntry` | `FunctionEntry` \| `undefined` |
| <a id="visitor"></a> `visitor` | `ESLintUtils.RuleListener` |
| <a id="property-visitor"></a> `visitor` | `ESLintUtils.RuleListener` |
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Function: findEnclosingComponentOrHook()

```ts
function findEnclosingComponentOrHook(node: Node | undefined, test: FindEnclosingComponentOrHookFilter):
function findEnclosingComponentOrHook(node: Node | undefined, test?: FindEnclosingComponentOrHookFilter):
| ArrowFunctionExpression
| FunctionDeclarationWithName
| FunctionDeclarationWithOptionalName
Expand Down
2 changes: 1 addition & 1 deletion packages/core/docs/functions/findParentJsxAttribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Function: findParentJsxAttribute()

```ts
function findParentJsxAttribute(node: Node, test: (node: JSXAttribute) => boolean): JSXAttribute | undefined;
function findParentJsxAttribute(node: Node, test?: (node: JSXAttribute) => boolean): JSXAttribute | undefined;
```

Traverses up the AST to find a parent JSX attribute node that matches a given test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
function isFunctionWithLooseComponentName(
context: RuleContext,
fn: TSESTreeFunction,
allowNone: boolean): boolean;
allowNone?: boolean): boolean;
```

Check if a function has a loose component name
Expand Down
2 changes: 1 addition & 1 deletion packages/core/docs/functions/isInitializedFromReact.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
function isInitializedFromReact(
name: string,
initialScope: Scope,
importSource: string): boolean;
importSource?: string): boolean;
```

Check if a variable is initialized from React import
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
function isInitializedFromReactNative(
name: string,
initialScope: Scope,
importSource: string): boolean;
importSource?: string): boolean;
```

if a variable is initialized from React Native import
Expand Down
2 changes: 1 addition & 1 deletion packages/core/docs/functions/isJsxLike.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function isJsxLike(
getScope: (node: Node) => Scope;
},
node: Node | null | undefined,
hint: bigint): boolean;
hint?: bigint): boolean;
```

Determine if a node represents JSX-like content based on heuristics
Expand Down
2 changes: 1 addition & 1 deletion packages/core/docs/functions/isUseEffectLikeCall.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Function: isUseEffectLikeCall()

```ts
function isUseEffectLikeCall(node: Node | undefined, additionalEffectHooks: RegExpLike): node is CallExpression;
function isUseEffectLikeCall(node: Node | undefined, additionalEffectHooks?: RegExpLike): node is CallExpression;
```

Detect useEffect calls and variations (useLayoutEffect, etc.) using a regex pattern
Expand Down
2 changes: 1 addition & 1 deletion packages/core/docs/functions/isUseStateLikeCall.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Function: isUseStateLikeCall()

```ts
function isUseStateLikeCall(node: Node | undefined, additionalStateHooks: RegExpLike): node is CallExpression;
function isUseStateLikeCall(node: Node | undefined, additionalStateHooks?: RegExpLike): node is CallExpression;
```

Detect useState calls and variations (useCustomState, etc.) using a regex pattern
Expand Down
2 changes: 1 addition & 1 deletion packages/core/docs/functions/useComponentCollector.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Function: useComponentCollector()

```ts
function useComponentCollector(context: RuleContext, options: Options): ReturnType;
function useComponentCollector(context: RuleContext, options?: Options): ReturnType;
```

Get a ctx and visitor object for the rule to collect function components
Expand Down
18 changes: 9 additions & 9 deletions packages/core/docs/interfaces/ClassComponentSemanticNode.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ Represents a React Class Component

| 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` | `BindingName` \| `undefined` | The identifier of the component | [`SemanticNode`](SemanticNode.md).[`id`](SemanticNode.md#id) | - |
| <a id="key"></a> `key` | `string` | The unique key of the node | - | [`SemanticNode`](SemanticNode.md).[`key`](SemanticNode.md#key) |
| <a id="kind"></a> `kind` | `"class-component"` | 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` | The name of the node | - | [`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) | - |
| <a id="property-displayname"></a> `displayName` | `Expression` \| `undefined` | The display name of the component | - | - |
| <a id="property-flag"></a> `flag` | `bigint` | Flags describing the component's characteristics | [`SemanticNode`](SemanticNode.md).[`flag`](SemanticNode.md#property-flag) | - |
| <a id="property-hint"></a> `hint` | `bigint` | Hint for how the component was detected | [`SemanticNode`](SemanticNode.md).[`hint`](SemanticNode.md#property-hint) | - |
| <a id="property-id"></a> `id` | `BindingName` \| `undefined` | The identifier of the component | [`SemanticNode`](SemanticNode.md).[`id`](SemanticNode.md#property-id) | - |
| <a id="property-key"></a> `key` | `string` | The unique key of the node | - | [`SemanticNode`](SemanticNode.md).[`key`](SemanticNode.md#property-key) |
| <a id="property-kind"></a> `kind` | `"class-component"` | The kind of component | [`SemanticNode`](SemanticNode.md).[`kind`](SemanticNode.md#property-kind) | - |
| <a id="property-methods"></a> `methods` | `TSESTreeMethodOrProperty`[] | List of methods and properties in the class | - | - |
| <a id="property-name"></a> `name` | `string` \| `undefined` | The name of the node | - | [`SemanticNode`](SemanticNode.md).[`name`](SemanticNode.md#property-name) |
| <a id="property-node"></a> `node` | `TSESTreeClass` | The AST node of the class | [`SemanticNode`](SemanticNode.md).[`node`](SemanticNode.md#property-node) | - |
24 changes: 12 additions & 12 deletions packages/core/docs/interfaces/ClientFunctionSemanticNode.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ Represents a React Client Function

| Property | Type | Description | Overrides | Inherited from |
| ------ | ------ | ------ | ------ | ------ |
| <a id="body"></a> `body` | `BlockStatement` \| `Expression` | The body of the function | - | [`SemanticFunc`](SemanticFunc.md).[`body`](SemanticFunc.md#body) |
| <a id="directives"></a> `directives` | `TSESTreeDirective`[] | The directives of the function (e.g., "use strict", "use client", "use server", etc.) | - | [`SemanticFunc`](SemanticFunc.md).[`directives`](SemanticFunc.md#directives) |
| <a id="flag"></a> `flag` | `bigint` | The flag of the node | - | [`SemanticFunc`](SemanticFunc.md).[`flag`](SemanticFunc.md#flag) |
| <a id="hint"></a> `hint` | `bigint` | The hint of the node | - | [`SemanticFunc`](SemanticFunc.md).[`hint`](SemanticFunc.md#hint) |
| <a id="id"></a> `id` | \| `ArrayExpression` \| `ArrayPattern` \| `ArrowFunctionExpression` \| `AssignmentExpression` \| `AwaitExpression` \| `PrivateInExpression` \| `SymmetricBinaryExpression` \| `CallExpression` \| `ChainExpression` \| `ClassExpression` \| `ConditionalExpression` \| `FunctionExpression` \| `Identifier` \| `ImportExpression` \| `JSXElement` \| `JSXFragment` \| `BigIntLiteral` \| `BooleanLiteral` \| `NullLiteral` \| `NumberLiteral` \| `RegExpLiteral` \| `StringLiteral` \| `LogicalExpression` \| `MemberExpressionComputedName` \| `MemberExpressionNonComputedName` \| `MetaProperty` \| `NewExpression` \| `ObjectExpression` \| `ObjectPattern` \| `PrivateIdentifier` \| `SequenceExpression` \| `Super` \| `TaggedTemplateExpression` \| `TemplateLiteral` \| `ThisExpression` \| `TSAsExpression` \| `TSInstantiationExpression` \| `TSNonNullExpression` \| `TSSatisfiesExpression` \| `TSTypeAssertion` \| `UnaryExpressionBitwiseNot` \| `UnaryExpressionDelete` \| `UnaryExpressionMinus` \| `UnaryExpressionNot` \| `UnaryExpressionPlus` \| `UnaryExpressionTypeof` \| `UnaryExpressionVoid` \| `UpdateExpression` \| `YieldExpression` \| `undefined` | The identifier of the function | - | [`SemanticFunc`](SemanticFunc.md).[`id`](SemanticFunc.md#id) |
| <a id="key"></a> `key` | `string` | The unique key of the node | - | [`SemanticFunc`](SemanticFunc.md).[`key`](SemanticFunc.md#key) |
| <a id="kind"></a> `kind` | `"client-function"` | The kind of function | [`SemanticFunc`](SemanticFunc.md).[`kind`](SemanticFunc.md#kind) | - |
| <a id="name"></a> `name` | `string` \| `undefined` | The name of the function | - | [`SemanticFunc`](SemanticFunc.md).[`name`](SemanticFunc.md#name) |
| <a id="node"></a> `node` | `TSESTreeFunction` | The AST node of the function | - | [`SemanticFunc`](SemanticFunc.md).[`node`](SemanticFunc.md#node) |
| <a id="parameters"></a> `parameters` | `Parameter`[] | The parameters of the function | - | [`SemanticFunc`](SemanticFunc.md).[`parameters`](SemanticFunc.md#parameters) |
| <a id="type"></a> `type` | `TSTypeAnnotation` \| `undefined` | The return type annotation of the function | - | [`SemanticFunc`](SemanticFunc.md).[`type`](SemanticFunc.md#type) |
| <a id="typeparameters"></a> `typeParameters` | `TSTypeParameterDeclaration` \| `undefined` | The type parameters of the function | - | [`SemanticFunc`](SemanticFunc.md).[`typeParameters`](SemanticFunc.md#typeparameters) |
| <a id="property-body"></a> `body` | `BlockStatement` \| `Expression` | The body of the function | - | [`SemanticFunc`](SemanticFunc.md).[`body`](SemanticFunc.md#property-body) |
| <a id="property-directives"></a> `directives` | `TSESTreeDirective`[] | The directives of the function (e.g., "use strict", "use client", "use server", etc.) | - | [`SemanticFunc`](SemanticFunc.md).[`directives`](SemanticFunc.md#property-directives) |
| <a id="property-flag"></a> `flag` | `bigint` | The flag of the node | - | [`SemanticFunc`](SemanticFunc.md).[`flag`](SemanticFunc.md#property-flag) |
| <a id="property-hint"></a> `hint` | `bigint` | The hint of the node | - | [`SemanticFunc`](SemanticFunc.md).[`hint`](SemanticFunc.md#property-hint) |
| <a id="property-id"></a> `id` | \| `ArrayExpression` \| `ArrayPattern` \| `ArrowFunctionExpression` \| `AssignmentExpression` \| `AwaitExpression` \| `PrivateInExpression` \| `SymmetricBinaryExpression` \| `CallExpression` \| `ChainExpression` \| `ClassExpression` \| `ConditionalExpression` \| `FunctionExpression` \| `Identifier` \| `ImportExpression` \| `JSXElement` \| `JSXFragment` \| `BigIntLiteral` \| `BooleanLiteral` \| `NullLiteral` \| `NumberLiteral` \| `RegExpLiteral` \| `StringLiteral` \| `LogicalExpression` \| `MemberExpressionComputedName` \| `MemberExpressionNonComputedName` \| `MetaProperty` \| `NewExpression` \| `ObjectExpression` \| `ObjectPattern` \| `PrivateIdentifier` \| `SequenceExpression` \| `Super` \| `TaggedTemplateExpression` \| `TemplateLiteral` \| `ThisExpression` \| `TSAsExpression` \| `TSInstantiationExpression` \| `TSNonNullExpression` \| `TSSatisfiesExpression` \| `TSTypeAssertion` \| `UnaryExpressionBitwiseNot` \| `UnaryExpressionDelete` \| `UnaryExpressionMinus` \| `UnaryExpressionNot` \| `UnaryExpressionPlus` \| `UnaryExpressionTypeof` \| `UnaryExpressionVoid` \| `UpdateExpression` \| `YieldExpression` \| `undefined` | The identifier of the function | - | [`SemanticFunc`](SemanticFunc.md).[`id`](SemanticFunc.md#property-id) |
| <a id="property-key"></a> `key` | `string` | The unique key of the node | - | [`SemanticFunc`](SemanticFunc.md).[`key`](SemanticFunc.md#property-key) |
| <a id="property-kind"></a> `kind` | `"client-function"` | The kind of function | [`SemanticFunc`](SemanticFunc.md).[`kind`](SemanticFunc.md#property-kind) | - |
| <a id="property-name"></a> `name` | `string` \| `undefined` | The name of the function | - | [`SemanticFunc`](SemanticFunc.md).[`name`](SemanticFunc.md#property-name) |
| <a id="property-node"></a> `node` | `TSESTreeFunction` | The AST node of the function | - | [`SemanticFunc`](SemanticFunc.md).[`node`](SemanticFunc.md#property-node) |
| <a id="property-parameters"></a> `parameters` | `Parameter`[] | The parameters of the function | - | [`SemanticFunc`](SemanticFunc.md).[`parameters`](SemanticFunc.md#property-parameters) |
| <a id="property-type"></a> `type` | `TSTypeAnnotation` \| `undefined` | The return type annotation of the function | - | [`SemanticFunc`](SemanticFunc.md).[`type`](SemanticFunc.md#property-type) |
| <a id="property-typeparameters"></a> `typeParameters` | `TSTypeParameterDeclaration` \| `undefined` | The type parameters of the function | - | [`SemanticFunc`](SemanticFunc.md).[`typeParameters`](SemanticFunc.md#property-typeparameters) |
Loading
Loading