Skip to content

Commit 94e14a7

Browse files
committed
Fix capitalization and wording in docs and comments
1 parent 3edeba0 commit 94e14a7

80 files changed

Lines changed: 183 additions & 144 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/core/docs/README.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
| Interface | Description |
1616
| ------ | ------ |
17-
| [ClassComponentSemanticNode](interfaces/ClassComponentSemanticNode.md) | Represents a React class component |
18-
| [ClientFunctionSemanticNode](interfaces/ClientFunctionSemanticNode.md) | Represents a React function |
19-
| [FunctionComponentSemanticNode](interfaces/FunctionComponentSemanticNode.md) | Represents a React function component |
17+
| [ClassComponentSemanticNode](interfaces/ClassComponentSemanticNode.md) | Represents a React Class Component |
18+
| [ClientFunctionSemanticNode](interfaces/ClientFunctionSemanticNode.md) | Represents a React Client Function |
19+
| [FunctionComponentSemanticNode](interfaces/FunctionComponentSemanticNode.md) | Represents a React Function Component |
2020
| [HookSemanticNode](interfaces/HookSemanticNode.md) | - |
2121
| [JsxConfig](interfaces/JsxConfig.md) | - |
2222
| [SemanticFunc](interfaces/SemanticFunc.md) | - |
2323
| [SemanticNode](interfaces/SemanticNode.md) | - |
24-
| [ServerFunctionSemanticNode](interfaces/ServerFunctionSemanticNode.md) | - |
24+
| [ServerFunctionSemanticNode](interfaces/ServerFunctionSemanticNode.md) | Represents a React Server Function |
2525

2626
## Type Aliases
2727

@@ -30,12 +30,12 @@
3030
| [ComponentDetectionHint](type-aliases/ComponentDetectionHint.md) | - |
3131
| [ComponentEffectPhaseKind](type-aliases/ComponentEffectPhaseKind.md) | - |
3232
| [ComponentFlag](type-aliases/ComponentFlag.md) | - |
33-
| [ComponentKind](type-aliases/ComponentKind.md) | - |
33+
| [ComponentKind](type-aliases/ComponentKind.md) | Represents the kind of a React component |
3434
| [ComponentLifecyclePhaseKind](type-aliases/ComponentLifecyclePhaseKind.md) | - |
3535
| [ComponentPhaseKind](type-aliases/ComponentPhaseKind.md) | - |
36-
| [ComponentSemanticNode](type-aliases/ComponentSemanticNode.md) | Union type representing either a class or function component |
36+
| [ComponentSemanticNode](type-aliases/ComponentSemanticNode.md) | Represents a React Component |
3737
| [FindEnclosingComponentOrHookFilter](type-aliases/FindEnclosingComponentOrHookFilter.md) | - |
38-
| [FunctionSemanticNode](type-aliases/FunctionSemanticNode.md) | - |
38+
| [FunctionSemanticNode](type-aliases/FunctionSemanticNode.md) | Represents a React Function |
3939
| [JsxAttributeValue](type-aliases/JsxAttributeValue.md) | Represents possible JSX attribute value types that can be resolved |
4040
| [JsxDetectionHint](type-aliases/JsxDetectionHint.md) | BitFlags for configuring JSX detection behavior |
4141

@@ -44,7 +44,7 @@
4444
| Variable | Description |
4545
| ------ | ------ |
4646
| [ComponentDetectionHint](variables/ComponentDetectionHint.md) | Hints for component collector |
47-
| [ComponentFlag](variables/ComponentFlag.md) | - |
47+
| [ComponentFlag](variables/ComponentFlag.md) | Component flag constants |
4848
| [ComponentPhaseRelevance](variables/ComponentPhaseRelevance.md) | - |
4949
| [DEFAULT\_COMPONENT\_DETECTION\_HINT](variables/DEFAULT_COMPONENT_DETECTION_HINT.md) | Default component detection hint |
5050
| [DEFAULT\_JSX\_DETECTION\_HINT](variables/DEFAULT_JSX_DETECTION_HINT.md) | Default JSX detection configuration Skips undefined and boolean literals (common in React) |
@@ -122,8 +122,8 @@
122122
| ------ | ------ |
123123
| [findEnclosingComponentOrHook](functions/findEnclosingComponentOrHook.md) | Find the enclosing React component or hook for a given AST node |
124124
| [findParentJsxAttribute](functions/findParentJsxAttribute.md) | Traverses up the AST to find a parent JSX attribute node that matches a given test |
125-
| [getComponentFlagFromInitPath](functions/getComponentFlagFromInitPath.md) | - |
126-
| [getFunctionComponentId](functions/getFunctionComponentId.md) | - |
125+
| [getComponentFlagFromInitPath](functions/getComponentFlagFromInitPath.md) | Get component flag from init path |
126+
| [getFunctionComponentId](functions/getFunctionComponentId.md) | Get function component identifier from `const Component = memo(() => {});` |
127127
| [getJsxAttribute](functions/getJsxAttribute.md) | Creates a helper function to find a specific JSX attribute by name Handles direct attributes and spread attributes (variables or object literals) |
128128
| [getJsxAttributeName](functions/getJsxAttributeName.md) | Get the stringified name of a JSX attribute |
129129
| [getJsxConfigFromAnnotation](functions/getJsxConfigFromAnnotation.md) | Get JsxConfig from pragma comments (annotations) in the source code |
@@ -132,42 +132,42 @@
132132
| [getPhaseKindOfFunction](functions/getPhaseKindOfFunction.md) | - |
133133
| [hasNoneOrLooseComponentName](functions/hasNoneOrLooseComponentName.md) | Check if the function has no name or a loose component name |
134134
| [isClassComponent](functions/isClassComponent.md) | Check if a node is a React class component |
135-
| [isComponentDefinition](functions/isComponentDefinition.md) | Determines if a function node represents a valid React component definition |
136-
| [isComponentDidMountCallback](functions/isComponentDidMountCallback.md) | Checks if the node is a function of `componentDidMount` |
135+
| [isComponentDefinition](functions/isComponentDefinition.md) | Determine if a function node represents a valid React component definition |
136+
| [isComponentDidMountCallback](functions/isComponentDidMountCallback.md) | Check if the given node is a componentDidMount callback |
137137
| [isComponentName](functions/isComponentName.md) | Check if a string matches the strict component name pattern |
138138
| [isComponentNameLoose](functions/isComponentNameLoose.md) | Check if a string matches the loose component name pattern |
139-
| [isComponentWillUnmountCallback](functions/isComponentWillUnmountCallback.md) | Checks if the node is a function of `componentWillUnmount` |
139+
| [isComponentWillUnmountCallback](functions/isComponentWillUnmountCallback.md) | Check if the given node is a componentWillUnmount callback |
140140
| [isComponentWrapperCall](functions/isComponentWrapperCall.md) | Check if the node is a call expression for a component wrapper |
141141
| [isComponentWrapperCallback](functions/isComponentWrapperCallback.md) | Check if the node is a callback function passed to a component wrapper |
142142
| [isComponentWrapperCallbackLoose](functions/isComponentWrapperCallbackLoose.md) | Check if the node is a callback function passed to a component wrapper loosely |
143143
| [isComponentWrapperCallLoose](functions/isComponentWrapperCallLoose.md) | Check if the node is a call expression for a component wrapper loosely |
144144
| [isDeclaredInRenderPropLoose](functions/isDeclaredInRenderPropLoose.md) | Unsafe check whether given node is declared inside a render prop `_ = <Component renderRow={"node"} /> ` ^^^^^^ ` _ = <Component rows={ [{ render: "node" }] } /> ` ^^^^^^ `` |
145-
| [isHook](functions/isHook.md) | Determines if a function node is a React Hook based on its name. |
145+
| [isHook](functions/isHook.md) | Determine if a function node is a React Hook based on its name. |
146146
| [isHookCall](functions/isHookCall.md) | Check if the given node is a React Hook call by its name. |
147-
| [isHookCallWithName](functions/isHookCallWithName.md) | Checks if a node is a call to a specific React hook. Returns a function that accepts a hook name to check against. |
147+
| [isHookCallWithName](functions/isHookCallWithName.md) | Check if a node is a call to a specific React hook. Returns a function that accepts a hook name to check against. |
148148
| [isHookId](functions/isHookId.md) | - |
149149
| [isHookName](functions/isHookName.md) | Catch all identifiers that begin with "use" followed by an uppercase Latin character to exclude identifiers like "user". |
150-
| [isInitializedFromReact](functions/isInitializedFromReact.md) | Checks if a variable is initialized or derived from React import |
151-
| [isInitializedFromReactNative](functions/isInitializedFromReactNative.md) | Checks if a variable is initialized from React Native import |
152-
| [isInitializedFromRef](functions/isInitializedFromRef.md) | Checks if the variable with the given name is initialized or derived from a ref |
153-
| [isInsideComponentOrHook](functions/isInsideComponentOrHook.md) | Checks if a given AST node is inside a React component or hook |
154-
| [isJsxFragmentElement](functions/isJsxFragmentElement.md) | Determines if a JSX element is a React Fragment Fragments can be imported from React and used like <Fragment> or <React.Fragment> |
155-
| [isJsxHostElement](functions/isJsxHostElement.md) | Determines if a JSX element is a host element Host elements in React start with lowercase letters (e.g., div, span) |
156-
| [isJsxLike](functions/isJsxLike.md) | Determines if a node represents JSX-like content based on heuristics Supports configuration through hint flags to customize detection behavior |
157-
| [isJsxText](functions/isJsxText.md) | Checks if a node is a `JSXText` or a `Literal` node |
150+
| [isInitializedFromReact](functions/isInitializedFromReact.md) | Check if a variable is initialized from React import |
151+
| [isInitializedFromReactNative](functions/isInitializedFromReactNative.md) | if a variable is initialized from React Native import |
152+
| [isInitializedFromRef](functions/isInitializedFromRef.md) | Check if the variable with the given name is initialized or derived from a ref |
153+
| [isInsideComponentOrHook](functions/isInsideComponentOrHook.md) | Check if a given AST node is inside a React component or hook |
154+
| [isJsxFragmentElement](functions/isJsxFragmentElement.md) | Determine if a JSX element is a React Fragment Fragments can be imported from React and used like <Fragment> or <React.Fragment> |
155+
| [isJsxHostElement](functions/isJsxHostElement.md) | Determine if a JSX element is a host element Host elements in React start with lowercase letters (e.g., div, span) |
156+
| [isJsxLike](functions/isJsxLike.md) | Determine if a node represents JSX-like content based on heuristics Supports configuration through hint flags to customize detection behavior |
157+
| [isJsxText](functions/isJsxText.md) | Check if a node is a `JSXText` or a `Literal` node |
158158
| [isPureComponent](functions/isPureComponent.md) | Check if a node is a React PureComponent |
159-
| [isReactAPI](functions/isReactAPI.md) | Checks if the node is a React API identifier or member expression |
160-
| [isReactAPICall](functions/isReactAPICall.md) | Checks if the node is a call expression to a specific React API |
161-
| [isRefName](functions/isRefName.md) | Checks if a given name corresponds to a ref name |
159+
| [isReactAPI](functions/isReactAPI.md) | Check if the node is a React API identifier or member expression |
160+
| [isReactAPICall](functions/isReactAPICall.md) | Check if the node is a call expression to a specific React API |
161+
| [isRefName](functions/isRefName.md) | Check if a given name corresponds to a ref name |
162162
| [isRenderFunctionLoose](functions/isRenderFunctionLoose.md) | Unsafe check whether given node is a render function `const renderRow = () => <div /> ` ^^^^^^^^^^^^` _ = <Component renderRow={() => <div />} /> ` ^^^^^^^^^^^^^ `` |
163163
| [isRenderMethodLike](functions/isRenderMethodLike.md) | Check whether given node is a render method of a class component |
164164
| [isRenderPropLoose](functions/isRenderPropLoose.md) | Unsafe check whether given JSXAttribute is a render prop `_ = <Component renderRow={() => <div />} /> ` ^^^^^^^^^^^^^^^^^^^^^^^^^ `` |
165-
| [isUseEffectCleanupCallback](functions/isUseEffectCleanupCallback.md) | Determines if a node is the cleanup function returned by a useEffect-like hook's setup function. |
166-
| [isUseEffectLikeCall](functions/isUseEffectLikeCall.md) | Detects useEffect calls and variations (useLayoutEffect, etc.) using regex pattern. |
167-
| [isUseEffectSetupCallback](functions/isUseEffectSetupCallback.md) | Determines if a node is the setup function passed to a useEffect-like hook |
168-
| [isUseStateLikeCall](functions/isUseStateLikeCall.md) | Detects useState calls and variations (useCustomState, etc.) using regex pattern. |
169-
| [resolveJsxAttributeValue](functions/resolveJsxAttributeValue.md) | Resolves the static value of a JSX attribute or spread attribute |
165+
| [isUseEffectCleanupCallback](functions/isUseEffectCleanupCallback.md) | Determine if a node is the cleanup function returned by a useEffect-like hook's setup function. |
166+
| [isUseEffectLikeCall](functions/isUseEffectLikeCall.md) | Detect useEffect calls and variations (useLayoutEffect, etc.) using a regex pattern |
167+
| [isUseEffectSetupCallback](functions/isUseEffectSetupCallback.md) | Determine if a node is the setup function passed to a useEffect-like hook |
168+
| [isUseStateLikeCall](functions/isUseStateLikeCall.md) | Detect useState calls and variations (useCustomState, etc.) using a regex pattern |
169+
| [resolveJsxAttributeValue](functions/resolveJsxAttributeValue.md) | Resolve the static value of a JSX attribute or spread attribute |
170170
| [stringifyJsx](functions/stringifyJsx.md) | Incomplete but sufficient stringification of JSX nodes for common use cases |
171-
| [useComponentCollector](functions/useComponentCollector.md) | Get a ctx and visitor for the rule to collect function components |
172-
| [useComponentCollectorLegacy](functions/useComponentCollectorLegacy.md) | Get a ctx and visitor object for the rule to collect class components |
173-
| [useHookCollector](functions/useHookCollector.md) | Get a ctx and visitor for the rule to collect hooks |
171+
| [useComponentCollector](functions/useComponentCollector.md) | Get a ctx and visitor object for the rule to collect function components |
172+
| [useComponentCollectorLegacy](functions/useComponentCollectorLegacy.md) | Get a ctx and visitor object for the rule to collect class componentss |
173+
| [useHookCollector](functions/useHookCollector.md) | Get a ctx and visitor object for the rule to collect hooks |

packages/core/docs/functions/getComponentFlagFromInitPath.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
function getComponentFlagFromInitPath(initPath: FunctionInitPath | undefined): bigint;
77
```
88

9+
Get component flag from init path
10+
911
## Parameters
1012

11-
| Parameter | Type |
12-
| ------ | ------ |
13-
| `initPath` | `FunctionInitPath` \| `undefined` |
13+
| Parameter | Type | Description |
14+
| ------ | ------ | ------ |
15+
| `initPath` | `FunctionInitPath` \| `undefined` | The init path of the function component |
1416

1517
## Returns
1618

1719
`bigint`
20+
21+
The component flag

packages/core/docs/functions/getFunctionComponentId.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@ function getFunctionComponentId(context: RuleContext, node: TSESTreeFunction):
5656
| undefined;
5757
```
5858

59+
Get function component identifier from `const Component = memo(() => {});`
60+
5961
## Parameters
6062

61-
| Parameter | Type |
62-
| ------ | ------ |
63-
| `context` | `RuleContext` |
64-
| `node` | `TSESTreeFunction` |
63+
| Parameter | Type | Description |
64+
| ------ | ------ | ------ |
65+
| `context` | `RuleContext` | The rule context |
66+
| `node` | `TSESTreeFunction` | The function node to analyze |
6567

6668
## Returns
6769

@@ -115,3 +117,5 @@ function getFunctionComponentId(context: RuleContext, node: TSESTreeFunction):
115117
\| `UpdateExpression`
116118
\| `YieldExpression`
117119
\| `undefined`
120+
121+
The function identifier or `unit` if not found

packages/core/docs/functions/isComponentDefinition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function isComponentDefinition(
99
hint: bigint): boolean;
1010
```
1111

12-
Determines if a function node represents a valid React component definition
12+
Determine if a function node represents a valid React component definition
1313

1414
## Parameters
1515

packages/core/docs/functions/isComponentDidMountCallback.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
function isComponentDidMountCallback(node: Node): boolean;
77
```
88

9-
Checks if the node is a function of `componentDidMount`
9+
Check if the given node is a componentDidMount callback
1010

1111
## Parameters
1212

1313
| Parameter | Type | Description |
1414
| ------ | ------ | ------ |
15-
| `node` | `Node` | The AST node to check |
15+
| `node` | `Node` | The node to check |
1616

1717
## Returns
1818

1919
`boolean`
2020

21-
`true` if the node is a function of `componentDidMount`
21+
True if the node is a componentDidMount callback, false otherwise

packages/core/docs/functions/isComponentWillUnmountCallback.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
function isComponentWillUnmountCallback(node: Node): boolean;
77
```
88

9-
Checks if the node is a function of `componentWillUnmount`
9+
Check if the given node is a componentWillUnmount callback
1010

1111
## Parameters
1212

1313
| Parameter | Type | Description |
1414
| ------ | ------ | ------ |
15-
| `node` | `Node` | The AST node to check |
15+
| `node` | `Node` | The node to check |
1616

1717
## Returns
1818

1919
`boolean`
2020

21-
`true` if the node is a function of `componentWillUnmount`
21+
True if the node is a componentWillUnmount callback, false otherwise

packages/core/docs/functions/isHook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
function isHook(node: TSESTreeFunction | undefined): boolean;
77
```
88

9-
Determines if a function node is a React Hook based on its name.
9+
Determine if a function node is a React Hook based on its name.
1010

1111
## Parameters
1212

packages/core/docs/functions/isHookCallWithName.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
function isHookCallWithName(node: Node | undefined): (name: string) => boolean;
77
```
88

9-
Checks if a node is a call to a specific React hook.
9+
Check if a node is a call to a specific React hook.
1010
Returns a function that accepts a hook name to check against.
1111

1212
## Parameters

packages/core/docs/functions/isInitializedFromReact.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function isInitializedFromReact(
99
importSource: string): boolean;
1010
```
1111

12-
Checks if a variable is initialized or derived from React import
12+
Check if a variable is initialized from React import
1313

1414
## Parameters
1515

packages/core/docs/functions/isInitializedFromReactNative.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function isInitializedFromReactNative(
99
importSource: string): boolean;
1010
```
1111

12-
Checks if a variable is initialized from React Native import
12+
if a variable is initialized from React Native import
1313

1414
## Parameters
1515

0 commit comments

Comments
 (0)