Skip to content

Commit b8066f9

Browse files
committed
refactor: capitalize "Hooks" in descriptions
1 parent b8e418d commit b8066f9

File tree

12 files changed

+18
-18
lines changed

12 files changed

+18
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function useAuth() {
247247

248248
### 🐞 Fixes
249249

250-
- `hooks-extra/no-useless-custom-hooks` should allow custom hooks with empty body.
250+
- `hooks-extra/no-useless-custom-hooks` should allow custom Hooks with empty body.
251251

252252
### 🪄 Improvements
253253

packages/plugins/eslint-plugin-react-hooks-extra/src/rules/no-useless-custom-hooks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ export default createRule<[], MessageID>({
2727
meta: {
2828
type: "problem",
2929
docs: {
30-
description: "enforce custom hooks to use at least one other hook inside",
30+
description: "enforce custom Hooks to use at least one other hook inside",
3131
[Symbol.for("rule_features")]: RULE_FEATURES,
3232
},
3333
messages: {
34-
noUselessCustomHooks: "A custom hook '{{name}}' should use at least one other hook.",
34+
noUselessCustomHooks: "A custom Hook '{{name}}' should use at least one other hook.",
3535
},
3636
schema: [],
3737
},

packages/plugins/eslint-plugin-react-web-api/src/rules/no-leaked-event-listener.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export default createRule<[], MessageID>({
145145
type: "problem",
146146
docs: {
147147
description:
148-
"enforce that every 'addEventListener' in a component or custom hook has a corresponding 'removeEventListener'.",
148+
"enforce that every 'addEventListener' in a component or custom Hook has a corresponding 'removeEventListener'.",
149149
[Symbol.for("rule_features")]: RULE_FEATURES,
150150
},
151151
messages: {

packages/plugins/eslint-plugin-react-web-api/src/rules/no-leaked-interval.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default createRule<[], MessageID>({
6262
type: "problem",
6363
docs: {
6464
description:
65-
"enforce that every 'setInterval' in a component or custom hook has a corresponding 'clearInterval'.",
65+
"enforce that every 'setInterval' in a component or custom Hook has a corresponding 'clearInterval'.",
6666
[Symbol.for("rule_features")]: RULE_FEATURES,
6767
},
6868
messages: {

packages/plugins/eslint-plugin-react-web-api/src/rules/no-leaked-resize-observer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export default createRule<[], MessageID>({
9292
meta: {
9393
type: "problem",
9494
docs: {
95-
description: "enforce cleanup of 'ResizeObserver' instances in components and custom hooks.",
95+
description: "enforce cleanup of 'ResizeObserver' instances in components and custom Hooks.",
9696
[Symbol.for("rule_features")]: RULE_FEATURES,
9797
},
9898
messages: {
@@ -101,7 +101,7 @@ export default createRule<[], MessageID>({
101101
noLeakedResizeObserverInControlFlow:
102102
"Dynamically added 'ResizeObserver.observe' should be cleared all at once using 'ResizeObserver.disconnect' in the cleanup function.",
103103
noLeakedResizeObserverNoFloatingInstance:
104-
"A 'ResizeObserver' instance created in component or custom hook must be assigned to a variable for proper cleanup.",
104+
"A 'ResizeObserver' instance created in component or custom Hook must be assigned to a variable for proper cleanup.",
105105
},
106106
schema: [],
107107
},

packages/plugins/eslint-plugin-react-web-api/src/rules/no-leaked-timeout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default createRule<[], MessageID>({
6161
meta: {
6262
type: "problem",
6363
docs: {
64-
description: "enforce that every 'setTimeout' in a component or custom hook has a corresponding 'clearTimeout'.",
64+
description: "enforce that every 'setTimeout' in a component or custom Hook has a corresponding 'clearTimeout'.",
6565
[Symbol.for("rule_features")]: RULE_FEATURES,
6666
},
6767
messages: {

packages/shared/src/schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { array, boolean, instance, object, optional, string } from "valibot";
88
* For example, the position of the `deps` argument for the user-defined `useCustomEffect` hook that represents the built-in `useEffect` hook.
99
*/
1010
export const CustomHookSchema = object({
11-
// TODO: Define the schema for custom hooks
11+
// TODO: Define the schema for custom Hooks
1212
});
1313

1414
/**

website/pages/docs/rules/overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@
102102

103103
| Rule || Features | Description |
104104
| :--------------------------------------------------------------- | :- | :------- | :---------------------------------------------------------------- |
105-
| [`no-leaked-event-listener`](web-api-no-leaked-event-listener) | 1️⃣ | `🔍` | Prevents leaked `addEventListener` in a component or custom hook. |
106-
| [`no-leaked-interval`](web-api-no-leaked-interval) | 1️⃣ | `🔍` | Prevents leaked `setInterval` in a component or custom hook. |
107-
| [`no-leaked-resize-observer`](web-api-no-leaked-resize-observer) | 1️⃣ | `🔍` | Prevents leaked `ResizeObserver` in a component or custom hook. |
108-
| [`no-leaked-timeout`](web-api-no-leaked-timeout) | 1️⃣ | `🔍` | Prevents leaked `setTimeout` in a component or custom hook. |
105+
| [`no-leaked-event-listener`](web-api-no-leaked-event-listener) | 1️⃣ | `🔍` | Prevents leaked `addEventListener` in a component or custom Hook. |
106+
| [`no-leaked-interval`](web-api-no-leaked-interval) | 1️⃣ | `🔍` | Prevents leaked `setInterval` in a component or custom Hook. |
107+
| [`no-leaked-resize-observer`](web-api-no-leaked-resize-observer) | 1️⃣ | `🔍` | Prevents leaked `ResizeObserver` in a component or custom Hook. |
108+
| [`no-leaked-timeout`](web-api-no-leaked-timeout) | 1️⃣ | `🔍` | Prevents leaked `setTimeout` in a component or custom Hook. |
109109

110110
## Hooks Extra Rules
111111

@@ -115,7 +115,7 @@
115115
| [`no-direct-set-state-in-use-layout-effect`](hooks-extra-no-direct-set-state-in-use-layout-effect) | 0️⃣ | `🔍` | Disallow direct calls to the `set` function of `useState` in `useLayoutEffect`. |
116116
| [`no-unnecessary-use-callback`](hooks-extra-no-unnecessary-use-callback) | 0️⃣ | `🔍` | Disallow unnecessary usage of `useCallback`. |
117117
| [`no-unnecessary-use-memo`](hooks-extra-no-unnecessary-use-memo) | 0️⃣ | `🔍` | Disallow unnecessary usage of `useMemo`. |
118-
| [`no-useless-custom-hooks`](hooks-extra-no-useless-custom-hooks) | 1️⃣ | `🔍` | Disallow redundant custom hooks definitions. |
118+
| [`no-useless-custom-hooks`](hooks-extra-no-useless-custom-hooks) | 1️⃣ | `🔍` | Enforces custom Hooks to use at least one other Hook. |
119119
| [`prefer-use-state-lazy-initialization`](hooks-extra-prefer-use-state-lazy-initialization) | 1️⃣ | `🔍` | Warns function calls made inside `useState` calls. |
120120

121121
### Deprecated

website/pages/docs/rules/web-api-no-leaked-event-listener.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ react-web-api/no-leaked-event-listener
2525

2626
## What it does
2727

28-
Enforces that every `addEventListener` in a component or custom hook has a corresponding `removeEventListener`.
28+
Enforces that every `addEventListener` in a component or custom Hook has a corresponding `removeEventListener`.
2929

3030
Adding an event listener without removing it can lead to memory leaks and unexpected behavior. This is because the event listener will continue to exist even after the component or hook is unmounted.
3131

website/pages/docs/rules/web-api-no-leaked-interval.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ react-web-api/no-leaked-interval
2525

2626
## What it does
2727

28-
Enforces that every `setInterval` in a component or custom hook has a corresponding `clearInterval`.
28+
Enforces that every `setInterval` in a component or custom Hook has a corresponding `clearInterval`.
2929

3030
Scheduling a interval within the setup function of `useEffect` without canceling it in the cleanup function can lead to unwanted `setInterval` callback executions and may also result in using stale values captured by previous render's effects after each subsequent re-render.
3131

0 commit comments

Comments
 (0)