Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(noUnusedFunctionParameters): add lint for unused function parameters, instead of using noUnusedVariables #2899

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b
- Add [nursery/noUnmatchableAnbSelector](https://biomejs.dev/linter/rules/no-unmatchable-anb-selector). [#2706](https://github.com/biomejs/biome/issues/2706) Contributed by @togami2864
- Add [nursery/useGenericFontNames](https://biomejs.dev/linter/rules/use-generic-font-names). [#2573](https://github.com/biomejs/biome/pull/2573) Contributed by @togami2864
- Add [nursery/noYodaExpression](https://biomejs.dev/linter/rules/no-yoda-expression/). Contributed by @michellocana
- Add [nursery/noUnusedFunctionParameters](https://biomejs.dev/linter/rules/no-unused-function-parameters/) Contributed by @printfn

#### Enhancements

Expand Down
103 changes: 61 additions & 42 deletions crates/biome_configuration/src/linter/rules.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/biome_diagnostics_categories/src/categories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ define_categories! {
"lint/nursery/noUnknownSelectorPseudoElement": "https://biomejs.dev/linter/rules/no-unknown-selector-pseudo-element",
"lint/nursery/noUnknownUnit": "https://biomejs.dev/linter/rules/no-unknown-unit",
"lint/nursery/noUnmatchableAnbSelector": "https://biomejs.dev/linter/rules/no-unmatchable-anb-selector",
"lint/nursery/noUnusedFunctionParameters": "https://biomejs.dev/linter/rules/no-unused-function-parameters",
"lint/nursery/noUselessStringConcat": "https://biomejs.dev/linter/rules/no-useless-string-concat",
"lint/nursery/noUselessUndefinedInitialization": "https://biomejs.dev/linter/rules/no-useless-undefined-initialization",
"lint/nursery/noYodaExpression": "https://biomejs.dev/linter/rules/no-yoda-expression",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ declare_rule! {
/// If you want to report unused imports,
/// enable [noUnusedImports](https://biomejs.dev/linter/rules/no-unused-imports/).
///
/// From `v1.9.0`, the rule won't check unused function parameters any more.
/// Users should switch to
/// [noUnusedFunctionParameters](https://biomejs.dev/linter/rules/no-unused-function-parameters/)
///
/// ## Examples
///
/// ### Invalid
Expand Down Expand Up @@ -65,7 +69,7 @@ declare_rule! {
/// export function f<T>() {}
/// ```
///
/// # Valid
/// ### Valid
///
/// ```js
/// function foo(b) {
Expand Down Expand Up @@ -99,7 +103,7 @@ declare_rule! {
}
}

/// Suggestion if the bindnig is unused
/// Suggestion if the binding is unused
#[derive(Debug)]
pub enum SuggestedFix {
/// No suggestion will be given
Expand Down
2 changes: 2 additions & 0 deletions crates/biome_js_analyze/src/lint/nursery.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading