Skip to content
Open
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
4 changes: 4 additions & 0 deletions crates/vite_global_cli/src/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,10 @@ fn delegated_help_doc(command: &str) -> Option<HelpDoc> {
row("--fix", "Auto-fix format and lint issues"),
row("--no-fmt", "Skip format check"),
row("--no-lint", "Skip lint check"),
row(
"--disable-nested-config",
"Disable the automatic loading of nested configuration files (lint only)",
),
row("-h, --help", "Print help"),
],
),
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/binding/src/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub(crate) async fn execute_check(
fix: bool,
no_fmt: bool,
no_lint: bool,
disable_nested_config: bool,
paths: Vec<String>,
envs: &Arc<FxHashMap<Arc<OsStr>, Arc<OsStr>>>,
cwd: &AbsolutePathBuf,
Expand Down Expand Up @@ -127,6 +128,9 @@ pub(crate) async fn execute_check(
// parser think linting never started. Force the default reporter here so the
// captured output is stable across local and CI environments.
args.push("--format=default".to_string());
if disable_nested_config {
args.push("--disable-nested-config".to_string());
}
if has_paths {
args.extend(paths.iter().cloned());
}
Expand Down
12 changes: 10 additions & 2 deletions packages/cli/binding/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,17 @@ async fn execute_direct_subcommand(
let cwd_arc: Arc<AbsolutePath> = cwd.clone().into();

let status = match subcommand {
SynthesizableSubcommand::Check { fix, no_fmt, no_lint, paths } => {
SynthesizableSubcommand::Check { fix, no_fmt, no_lint, disable_nested_config, paths } => {
return crate::check::execute_check(
&resolver, fix, no_fmt, no_lint, paths, &envs, cwd, &cwd_arc,
&resolver,
fix,
no_fmt,
no_lint,
disable_nested_config,
paths,
&envs,
cwd,
&cwd_arc,
)
.await;
}
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/binding/src/cli/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ pub enum SynthesizableSubcommand {
/// Skip lint check
#[arg(long = "no-lint")]
no_lint: 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<String>,
Expand Down
27 changes: 15 additions & 12 deletions packages/cli/snap-tests-global/command-check-help/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ Usage: vp check [OPTIONS] [PATHS]...
Run format, lint, and type checks.

Options:
--fix Auto-fix format and lint issues
--no-fmt Skip format check
--no-lint Skip lint check
-h, --help Print help
--fix Auto-fix format and lint issues
--no-fmt Skip format check
--no-lint Skip lint check
--disable-nested-config Disable the automatic loading of nested configuration files (lint only)
-h, --help Print help

Examples:
vp check
Expand All @@ -27,10 +28,11 @@ Usage: vp check [OPTIONS] [PATHS]...
Run format, lint, and type checks.

Options:
--fix Auto-fix format and lint issues
--no-fmt Skip format check
--no-lint Skip lint check
-h, --help Print help
--fix Auto-fix format and lint issues
--no-fmt Skip format check
--no-lint Skip lint check
--disable-nested-config Disable the automatic loading of nested configuration files (lint only)
-h, --help Print help

Examples:
vp check
Expand All @@ -48,10 +50,11 @@ Usage: vp check [OPTIONS] [PATHS]...
Run format, lint, and type checks.

Options:
--fix Auto-fix format and lint issues
--no-fmt Skip format check
--no-lint Skip lint check
-h, --help Print help
--fix Auto-fix format and lint issues
--no-fmt Skip format check
--no-lint Skip lint check
--disable-nested-config Disable the automatic loading of nested configuration files (lint only)
-h, --help Print help

Examples:
vp check
Expand Down
Loading