Skip to content

Commit 98cf350

Browse files
committed
Updated changeset to mention bugfix
1 parent 98882db commit 98cf350

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

.changeset/old-seas-drum.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,39 @@
22
"@biomejs/biome": patch
33
---
44

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.
66

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+
function component() {
33+
let thing = 5;
34+
// The rule will now correctly flag `thing` as missing instead of complaining about
35+
// missing dependency arrays
36+
doSomething([], "blah", () => {console.log(thing)})
37+
}
38+
```
39+
40+
The rule documentation & diagnostic messages have also been reworked for improved clarity.

0 commit comments

Comments
 (0)