From c1ed5e87fbe2bd11c5e685a004250882dc7fa408 Mon Sep 17 00:00:00 2001 From: MK Date: Tue, 14 Apr 2026 15:14:38 +0800 Subject: [PATCH] feat(check): support `--disable-nested-config` flag Forward the flag to oxlint only; silently ignored for fmt since oxfmt does not support it. --- crates/vite_global_cli/src/help.rs | 4 ++++ packages/cli/binding/src/check/mod.rs | 4 ++++ packages/cli/binding/src/cli/mod.rs | 2 ++ packages/cli/binding/src/cli/types.rs | 3 +++ packages/cli/snap-tests-global/command-check-help/snap.txt | 3 +++ 5 files changed, 16 insertions(+) diff --git a/crates/vite_global_cli/src/help.rs b/crates/vite_global_cli/src/help.rs index 7fadebc0db..c9c1253018 100644 --- a/crates/vite_global_cli/src/help.rs +++ b/crates/vite_global_cli/src/help.rs @@ -765,6 +765,10 @@ fn delegated_help_doc(command: &str) -> Option { "--no-error-on-unmatched-pattern", "Do not exit with error when pattern is unmatched", ), + row( + "--disable-nested-config", + "Disable the automatic loading of nested configuration files (lint only)", + ), row("-h, --help", "Print help"), ], ), diff --git a/packages/cli/binding/src/check/mod.rs b/packages/cli/binding/src/check/mod.rs index 722a52578c..c7ba1541f0 100644 --- a/packages/cli/binding/src/check/mod.rs +++ b/packages/cli/binding/src/check/mod.rs @@ -23,6 +23,7 @@ pub(crate) async fn execute_check( no_fmt: bool, no_lint: bool, no_error_on_unmatched_pattern: bool, + disable_nested_config: bool, paths: Vec, envs: &Arc, Arc>>, cwd: &AbsolutePathBuf, @@ -143,6 +144,9 @@ pub(crate) async fn execute_check( if suppress_unmatched { args.push("--no-error-on-unmatched-pattern".to_string()); } + if disable_nested_config { + args.push("--disable-nested-config".to_string()); + } if has_paths { args.extend(paths.iter().cloned()); } diff --git a/packages/cli/binding/src/cli/mod.rs b/packages/cli/binding/src/cli/mod.rs index f94443964b..0586e3e910 100644 --- a/packages/cli/binding/src/cli/mod.rs +++ b/packages/cli/binding/src/cli/mod.rs @@ -68,6 +68,7 @@ async fn execute_direct_subcommand( no_fmt, no_lint, no_error_on_unmatched_pattern, + disable_nested_config, paths, } => { return crate::check::execute_check( @@ -76,6 +77,7 @@ async fn execute_direct_subcommand( no_fmt, no_lint, no_error_on_unmatched_pattern, + disable_nested_config, paths, &envs, cwd, diff --git a/packages/cli/binding/src/cli/types.rs b/packages/cli/binding/src/cli/types.rs index 8764d001a4..1f84eeb702 100644 --- a/packages/cli/binding/src/cli/types.rs +++ b/packages/cli/binding/src/cli/types.rs @@ -96,6 +96,9 @@ pub enum SynthesizableSubcommand { /// Do not exit with error when pattern is unmatched #[arg(long = "no-error-on-unmatched-pattern")] no_error_on_unmatched_pattern: bool, + /// Disable the automatic loading of nested configuration files (forwarded to lint; ignored by fmt) + #[arg(long)] + disable_nested_config: bool, /// File paths to check (passed through to fmt and lint) #[arg(trailing_var_arg = true)] paths: Vec, diff --git a/packages/cli/snap-tests-global/command-check-help/snap.txt b/packages/cli/snap-tests-global/command-check-help/snap.txt index 830728f645..f086c70853 100644 --- a/packages/cli/snap-tests-global/command-check-help/snap.txt +++ b/packages/cli/snap-tests-global/command-check-help/snap.txt @@ -10,6 +10,7 @@ Options: --no-fmt Skip format check --no-lint Skip lint check --no-error-on-unmatched-pattern Do not exit with error when pattern is unmatched + --disable-nested-config Disable the automatic loading of nested configuration files (lint only) -h, --help Print help Examples: @@ -32,6 +33,7 @@ Options: --no-fmt Skip format check --no-lint Skip lint check --no-error-on-unmatched-pattern Do not exit with error when pattern is unmatched + --disable-nested-config Disable the automatic loading of nested configuration files (lint only) -h, --help Print help Examples: @@ -54,6 +56,7 @@ Options: --no-fmt Skip format check --no-lint Skip lint check --no-error-on-unmatched-pattern Do not exit with error when pattern is unmatched + --disable-nested-config Disable the automatic loading of nested configuration files (lint only) -h, --help Print help Examples: