You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .changeset/old-seas-drum.md
+35-2Lines changed: 35 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,39 @@
2
2
"@biomejs/biome": patch
3
3
---
4
4
5
-
The rule documentation & diagnostic messages for `useExhaustiveDependencies` have been reworked for improved clarity among those not immediately familiar with React idioms.
5
+
[`useExhaustiveDependencies`](https://biomejs.dev/linter/rules/use-exhaustive-dependencies) can now validate custom hooks whose dependency arrays come before their callbacks.
6
6
7
-
Among other things, it clearly explains why incorrect dependencies are undesireable.
7
+
Previously, a logical error caused the rule to be unable to detect dependency arrays placed before hook callbacks, producing spurious errors that blocked further diagnostics.
8
+
```json
9
+
{
10
+
"linter": {
11
+
"rules": {
12
+
"correctness": {
13
+
"useExhaustiveDependencies": {
14
+
"level": "error",
15
+
"options": {
16
+
"hooks": [
17
+
{
18
+
"name": "doSomething",
19
+
"closureIndex": 2,
20
+
"dependenciesIndex": 0
21
+
}
22
+
]
23
+
}
24
+
}
25
+
}
26
+
}
27
+
}
28
+
}
29
+
```
30
+
31
+
```js
32
+
functioncomponent() {
33
+
let thing =5;
34
+
// The rule will now correctly flag `thing` as missing instead of complaining about
0 commit comments