Commit 8c19b18
committed
feat(linter/exhaustive-deps): implement fixer for dep in global scope (#13783)
In the below example, `x` is a useless dependency, as changes to `x`
will not trigger a re-rended as it is not in the component scope.
This commit implements a fixer that removes the dependency from the
dependency array.
```
const x = {}
function MyComponent() {
useEffect(() => {}, [x])
}
```1 parent 06bce8f commit 8c19b18
1 file changed
+12
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
564 | 567 | | |
565 | 568 | | |
566 | 569 | | |
| |||
4197 | 4200 | | |
4198 | 4201 | | |
4199 | 4202 | | |
| 4203 | + | |
| 4204 | + | |
| 4205 | + | |
| 4206 | + | |
4200 | 4207 | | |
4201 | 4208 | | |
4202 | 4209 | | |
| |||
0 commit comments