Skip to content

Commit 92011a4

Browse files
feat(biome_js_analyse): added new option to rule to ignore unused function parameters
1 parent 9ea46cc commit 92011a4

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

crates/biome_js_analyze/src/lint/correctness/no_unused_function_parameters.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ declare_lint_rule! {
5757
///
5858
/// ### `ignoreRestSiblings`
5959
/// **Since `v2.1.0`**
60-
///
60+
///
6161
/// Whether to ignore unused variables from an object destructuring with a spread.
6262
/// Example: `a` and `b` in `function({ a, b, ...rest }) { return rest;}` should be ignored by this rule when set to false.
6363
///
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
use biome_deserialize_macros::Deserializable;
22
use serde::{Deserialize, Serialize};
3-
#[derive(Default, Clone, Debug, Deserialize, Deserializable, Eq, PartialEq, Serialize)]
3+
#[derive(Clone, Debug, Deserialize, Deserializable, Eq, PartialEq, Serialize)]
44
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
55
#[serde(rename_all = "camelCase", deny_unknown_fields, default)]
66
pub struct NoUnusedFunctionParametersOptions {
77
/// Whether to ignore unused variables from an object destructuring with a spread.
88
#[serde(default)]
99
pub ignore_rest_siblings: bool,
1010
}
11+
12+
impl Default for NoUnusedFunctionParametersOptions {
13+
fn default() -> Self {
14+
Self {
15+
ignore_rest_siblings: true,
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)