-
-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lint): don't report missing dependency on incomplete statement (#…
- Loading branch information
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
crates/biome_js_analyze/tests/specs/correctness/useExhaustiveDependencies/issue4567.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import {useCallback,utte } from"react"; | ||
function{ | ||
const [width,(dh] = useCallback(() =>{ width) }, [w |
34 changes: 34 additions & 0 deletions
34
crates/biome_js_analyze/tests/specs/correctness/useExhaustiveDependencies/issue4567.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
source: crates/biome_js_analyze/tests/spec_tests.rs | ||
expression: issue4567.js | ||
--- | ||
# Input | ||
```js | ||
import {useCallback,utte } from"react"; | ||
function{ | ||
const [width,(dh] = useCallback(() =>{ width) }, [w | ||
|
||
``` | ||
# Diagnostics | ||
``` | ||
issue4567.js:3:24 lint/correctness/useExhaustiveDependencies ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
! This hook specifies more dependencies than necessary: w | ||
|
||
1 │ import {useCallback,utte } from"react"; | ||
2 │ function{ | ||
> 3 │ const [width,(dh] = useCallback(() =>{ width) }, [w | ||
│ ^^^^^^^^^^^ | ||
4 │ | ||
|
||
i This dependency can be removed from the list. | ||
|
||
1 │ import {useCallback,utte } from"react"; | ||
2 │ function{ | ||
> 3 │ const [width,(dh] = useCallback(() =>{ width) }, [w | ||
│ ^ | ||
4 │ | ||
|
||
|
||
``` |