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
12 changes: 12 additions & 0 deletions apps/oxlint/src/command/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ pub struct LintCommand {
#[bpaf(external)]
pub misc_options: MiscOptions,

/// Enables automatic loading of nested configuration files (experimental feature)
#[bpaf(switch, hide_usage)]
pub experimental_nested_config: bool,

/// Single file, single path or list of paths
#[bpaf(positional("PATH"), many, guard(validate_paths, PATHS_ERROR_MESSAGE))]
pub paths: Vec<PathBuf>,
Expand Down Expand Up @@ -513,4 +517,12 @@ mod lint_options {
let options = get_lint_options("--rules");
assert!(options.list_rules);
}

#[test]
fn experimental_nested_config() {
let options = get_lint_options("--experimental-nested-config");
assert!(options.experimental_nested_config);
let options = get_lint_options(".");
assert!(!options.experimental_nested_config);
}
}
2 changes: 2 additions & 0 deletions tasks/website/src/linter/snapshots/cli.snap
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ Arguments:
## Available options:
- **` --rules`** &mdash;
list all the rules that are currently registered
- **` --experimental-nested-config`** &mdash;
Enables automatic loading of nested configuration files (experimental feature)
- **`-h`**, **`--help`** &mdash;
Prints help information
- **`-V`**, **`--version`** &mdash;
Expand Down
2 changes: 2 additions & 0 deletions tasks/website/src/linter/snapshots/cli_terminal.snap
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,7 @@ Available positional items:

Available options:
--rules list all the rules that are currently registered
--experimental-nested-config Enables automatic loading of nested configuration files
(experimental feature)
-h, --help Prints help information
-V, --version Prints version information
Loading