Skip to content

Commit 1edd010

Browse files
committed
feat(oxlint): add --experimental-nested-config option
1 parent 814eab6 commit 1edd010

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

apps/oxlint/src/command/lint.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ pub struct LintCommand {
4141
#[bpaf(external)]
4242
pub misc_options: MiscOptions,
4343

44+
/// Enables automatic loading of nested configuration files (experimental feature)
45+
#[bpaf(switch, hide_usage)]
46+
pub experimental_nested_config: bool,
47+
4448
/// Single file, single path or list of paths
4549
#[bpaf(positional("PATH"), many, guard(validate_paths, PATHS_ERROR_MESSAGE))]
4650
pub paths: Vec<PathBuf>,
@@ -513,4 +517,12 @@ mod lint_options {
513517
let options = get_lint_options("--rules");
514518
assert!(options.list_rules);
515519
}
520+
521+
#[test]
522+
fn experimental_nested_config() {
523+
let options = get_lint_options("--experimental-nested-config");
524+
assert!(options.experimental_nested_config);
525+
let options = get_lint_options(".");
526+
assert!(!options.experimental_nested_config);
527+
}
516528
}

tasks/website/src/linter/snapshots/cli.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ Arguments:
133133
## Available options:
134134
- **` --rules`** &mdash;
135135
list all the rules that are currently registered
136+
- **` --experimental-nested-config`** &mdash;
137+
Enables automatic loading of nested configuration files (experimental feature)
136138
- **`-h`**, **`--help`** &mdash;
137139
Prints help information
138140
- **`-V`**, **`--version`** &mdash;

tasks/website/src/linter/snapshots/cli_terminal.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,7 @@ Available positional items:
8181

8282
Available options:
8383
--rules list all the rules that are currently registered
84+
--experimental-nested-config Enables automatic loading of nested configuration files
85+
(experimental feature)
8486
-h, --help Prints help information
8587
-V, --version Prints version information

0 commit comments

Comments
 (0)