Skip to content

Commit

Permalink
feat(oxlint): add --experimental-nested-config option
Browse files Browse the repository at this point in the history
  • Loading branch information
camchenry committed Feb 16, 2025
1 parent 19fdf89 commit 5d576be
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
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

0 comments on commit 5d576be

Please sign in to comment.