Skip to content

Commit 496843a

Browse files
committed
docs: update rules overview documentation with clarification notes
1 parent 0fe3f23 commit 496843a

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

apps/website/content/docs/rules/overview.mdx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,26 @@ Linter rules can have false positives, false negatives, and some rules are depen
107107

108108
| Rule || Description |
109109
| :----------------------------------------------------------------- | :-- | :--------------------------------------------------------------- |
110-
| [`no-leaked-event-listener`](./web-api-no-leaked-event-listener) | 1️⃣ | Prevents leaked `addEventListener` in a component or custom Hook |
111-
| [`no-leaked-interval`](./web-api-no-leaked-interval) | 1️⃣ | Prevents leaked `setInterval` in a component or custom Hook |
112-
| [`no-leaked-resize-observer`](./web-api-no-leaked-resize-observer) | 1️⃣ | Prevents leaked `ResizeObserver` in a component or custom Hook |
113-
| [`no-leaked-timeout`](./web-api-no-leaked-timeout) | 1️⃣ | Prevents leaked `setTimeout` in a component or custom Hook |
110+
| [`no-leaked-event-listener`](./web-api-no-leaked-event-listener) | 1️⃣ | Prevents leaked `addEventListener` in a component or custom hook |
111+
| [`no-leaked-interval`](./web-api-no-leaked-interval) | 1️⃣ | Prevents leaked `setInterval` in a component or custom hook |
112+
| [`no-leaked-resize-observer`](./web-api-no-leaked-resize-observer) | 1️⃣ | Prevents leaked `ResizeObserver` in a component or custom hook |
113+
| [`no-leaked-timeout`](./web-api-no-leaked-timeout) | 1️⃣ | Prevents leaked `setTimeout` in a component or custom hook |
114114

115115
## Hooks Extra Rules
116116

117+
<Callout type="info" title="NOTE">
118+
119+
This section contains rules that are not part of the official `eslint-plugin-react-hooks` plugin but are useful for specific use cases or patterns.
120+
121+
</Callout>
122+
117123
| Rule || 🌟 | Description |
118124
| :--------------------------------------------------------------------------------------------------- | :-- | :--: | :---------------------------------------------------------------------------------------- |
119125
| [`no-direct-set-state-in-use-effect`](./hooks-extra-no-direct-set-state-in-use-effect) | 1️⃣ | `🧪` | Disallow direct calls to the `set` function of `useState` in `useEffect` |
120126
| [`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` |
121127
| [`no-unnecessary-use-callback`](./hooks-extra-no-unnecessary-use-callback) | 0️⃣ | `🧪` | Disallow unnecessary usage of `useCallback` |
122128
| [`no-unnecessary-use-memo`](./hooks-extra-no-unnecessary-use-memo) | 0️⃣ | `🧪` | Disallow unnecessary usage of `useMemo` |
123-
| [`no-unnecessary-use-prefix`](./hooks-extra-no-unnecessary-use-prefix) | 1️⃣ | | Enforces that a function with the `use` prefix should use at least one Hook inside of it |
129+
| [`no-unnecessary-use-prefix`](./hooks-extra-no-unnecessary-use-prefix) | 1️⃣ | | Enforces that a function with the `use` prefix should use at least one hook inside of it |
124130
| [`prefer-use-state-lazy-initialization`](./hooks-extra-prefer-use-state-lazy-initialization) | 1️⃣ | | Enforces function calls made inside `useState` to be wrapped in an `initializer function` |
125131

126132
## Naming Convention Rules
@@ -135,6 +141,12 @@ Linter rules can have false positives, false negatives, and some rules are depen
135141

136142
## Debug Rules
137143

144+
<Callout type="info" title="TIP">
145+
146+
These rules are useful for static analysis, code transformation, or when building custom tooling that needs to identify specific React patterns.
147+
148+
</Callout>
149+
138150
| Rule || 🌟 | Description |
139151
| :------------------------------------------------- | :-- | :--: | :------------------------------------------------------ |
140152
| [`class-component`](./debug-class-component) | 0️⃣ | `🐞` | Reports all class components |

packages/plugins/eslint-plugin-react-debug/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Debugging rules.
44

5+
These rules are useful for static analysis, code transformation, or when building custom tooling that needs to identify specific React patterns.
6+
57
## Install
68

79
```sh

0 commit comments

Comments
 (0)