Skip to content
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
22 changes: 2 additions & 20 deletions crates/oxc_linter/src/rules/eslint/no_unused_vars/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ use serde_json::Value;
#[non_exhaustive]
pub struct NoUnusedVarsOptions {
/// Controls how usage of a variable in the global scope is checked.
///
/// This option has two settings:
/// 1. `all` checks all variables for usage, including those in the global
/// scope. This is the default setting.
/// 2. `local` checks only that locally-declared variables are used but will
/// allow global variables to be unused.
pub vars: VarsOption,
/// Specifies exceptions to this rule for unused variables. Variables whose
/// names match this pattern will be ignored.
Expand All @@ -38,14 +32,6 @@ pub struct NoUnusedVarsOptions {
/// ```
pub vars_ignore_pattern: IgnorePattern<Regex>,
/// Controls how unused arguments are checked.
///
/// This option has three settings:
/// 1. `after-used` - Unused positional arguments that occur before the last
/// used argument will not be checked, but all named arguments and all
/// positional arguments after the last used argument will be checked.
/// This is the default setting.
/// 2. `all` - All named arguments must be used.
/// 3. `none` - Do not check arguments.
pub args: ArgsOption,
/// Specifies exceptions to this rule for unused arguments. Arguments whose
/// names match this pattern will be ignored.
Expand Down Expand Up @@ -82,12 +68,6 @@ pub struct NoUnusedVarsOptions {
/// ```
pub ignore_rest_siblings: bool,
/// Used for `catch` block validation.
///
/// It has two settings:
/// * `none` - do not check error objects. This is the default setting.
/// * `all` - all named arguments must be used.
///
/// `none` corresponds to `false`, while `all` corresponds to `true`.
#[schemars(with = "CaughtErrorsJson")]
pub caught_errors: CaughtErrors,
/// Specifies exceptions to this rule for errors caught within a `catch` block.
Expand Down Expand Up @@ -413,7 +393,9 @@ pub struct CaughtErrors(bool);
#[serde(rename_all = "kebab-case")]
#[expect(dead_code)]
enum CaughtErrorsJson {
/// All named arguments must be used.
All,
/// Do not check error objects.
#[default]
None,
}
Expand Down
30 changes: 12 additions & 18 deletions tasks/website_linter/src/rules/snapshots/docs_rule_pages.snap
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,6 @@ default: `"after-used"`

Controls how unused arguments are checked.

This option has three settings:
1. `after-used` - Unused positional arguments that occur before the last
used argument will not be checked, but all named arguments and all
positional arguments after the last used argument will be checked.
This is the default setting.
2. `all` - All named arguments must be used.
3. `none` - Do not check arguments.


#### `"after-used"`

Expand Down Expand Up @@ -257,11 +249,19 @@ type: `"all" | "none"`

Used for `catch` block validation.

It has two settings:
* `none` - do not check error objects. This is the default setting.
* `all` - all named arguments must be used.

`none` corresponds to `false`, while `all` corresponds to `true`.
#### `"all"`



All named arguments must be used.


#### `"none"`



Do not check error objects.


### caughtErrorsIgnorePattern
Expand Down Expand Up @@ -486,12 +486,6 @@ default: `"all"`

Controls how usage of a variable in the global scope is checked.

This option has two settings:
1. `all` checks all variables for usage, including those in the global
scope. This is the default setting.
2. `local` checks only that locally-declared variables are used but will
allow global variables to be unused.


#### `"all"`

Expand Down
Loading