-
-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(noUnusedVariables): add option to ignore unused function arguments
- Loading branch information
Showing
7 changed files
with
163 additions
and
8 deletions.
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
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
15 changes: 15 additions & 0 deletions
15
...e_js_analyze/tests/specs/correctness/noUnusedVariables/validIgnoredArguments.options.json
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,15 @@ | ||
{ | ||
"$schema": "../../../../../../packages/@biomejs/biome/configuration_schema.json", | ||
"linter": { | ||
"rules": { | ||
"correctness": { | ||
"noUnusedVariables": { | ||
"level": "error", | ||
"options": { | ||
"args": "none" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
crates/biome_js_analyze/tests/specs/correctness/noUnusedVariables/validIgnoredArguments.ts
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,7 @@ | ||
/* should not generate diagnostics because we're ignoring unused arguments */ | ||
|
||
export function foo(a: string) { | ||
return 5; | ||
} | ||
|
||
export function bar({ a, b = 5 }: { a: number, b?: number }) {} |
15 changes: 15 additions & 0 deletions
15
.../biome_js_analyze/tests/specs/correctness/noUnusedVariables/validIgnoredArguments.ts.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,15 @@ | ||
--- | ||
source: crates/biome_js_analyze/tests/spec_tests.rs | ||
expression: validIgnoredArguments.ts | ||
--- | ||
# Input | ||
```ts | ||
/* should not generate diagnostics because we're ignoring unused arguments */ | ||
|
||
export function foo(a: string) { | ||
return 5; | ||
} | ||
|
||
export function bar({ a, b = 5 }: { a: number, b?: number }) {} | ||
|
||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.