-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add some context to the unused variable warning
- Loading branch information
Showing
3 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
jscomp/build_tests/super_errors/expected/unused_variable.res.expected
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,14 @@ | ||
|
||
[1;33mWarning number 26[0m | ||
[36m/.../fixtures/unused_variable.res[0m:[2m2:7[0m | ||
|
||
1 [2m│[0m let x = { | ||
[1;33m2[0m [2m│[0m let [1;33mf[0m = 12 | ||
3 [2m│[0m 13 | ||
4 [2m│[0m } | ||
|
||
unused variable f. | ||
|
||
Fix this by: | ||
- Prepending the variable name with `_` (like `_f`) to ignore that the variable is unused. | ||
- Use the variable somewhere. |
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,4 @@ | ||
let x = { | ||
let f = 12 | ||
13 | ||
} |
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