From 4c1d06030cb8200ba122879b7d0d1e202a517f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A2=85=EA=B2=BD?= Date: Sat, 18 Apr 2026 19:14:51 +0900 Subject: [PATCH 01/10] feat(cli): add --no-type-check flag to check subcommand --- crates/vite_global_cli/src/help.rs | 1 + packages/cli/binding/src/check/mod.rs | 1 + 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, 10 insertions(+) diff --git a/crates/vite_global_cli/src/help.rs b/crates/vite_global_cli/src/help.rs index 7fadebc0db..f222ec3467 100644 --- a/crates/vite_global_cli/src/help.rs +++ b/crates/vite_global_cli/src/help.rs @@ -761,6 +761,7 @@ fn delegated_help_doc(command: &str) -> Option { row("--fix", "Auto-fix format and lint issues"), row("--no-fmt", "Skip format check"), row("--no-lint", "Skip lint check"), + row("--no-type-check", "Skip type check"), row( "--no-error-on-unmatched-pattern", "Do not exit with error when pattern is unmatched", diff --git a/packages/cli/binding/src/check/mod.rs b/packages/cli/binding/src/check/mod.rs index 722a52578c..6777cc2c8a 100644 --- a/packages/cli/binding/src/check/mod.rs +++ b/packages/cli/binding/src/check/mod.rs @@ -22,6 +22,7 @@ pub(crate) async fn execute_check( fix: bool, no_fmt: bool, no_lint: bool, + _no_type_check: bool, no_error_on_unmatched_pattern: bool, paths: Vec, envs: &Arc, Arc>>, diff --git a/packages/cli/binding/src/cli/mod.rs b/packages/cli/binding/src/cli/mod.rs index f94443964b..5f00d734cf 100644 --- a/packages/cli/binding/src/cli/mod.rs +++ b/packages/cli/binding/src/cli/mod.rs @@ -67,6 +67,7 @@ async fn execute_direct_subcommand( fix, no_fmt, no_lint, + no_type_check, no_error_on_unmatched_pattern, paths, } => { @@ -75,6 +76,7 @@ async fn execute_direct_subcommand( fix, no_fmt, no_lint, + no_type_check, no_error_on_unmatched_pattern, paths, &envs, diff --git a/packages/cli/binding/src/cli/types.rs b/packages/cli/binding/src/cli/types.rs index 0d2a7455ba..29c11ee224 100644 --- a/packages/cli/binding/src/cli/types.rs +++ b/packages/cli/binding/src/cli/types.rs @@ -93,6 +93,9 @@ pub enum SynthesizableSubcommand { /// Skip lint check #[arg(long = "no-lint")] no_lint: bool, + /// Skip type check + #[arg(long = "no-type-check")] + no_type_check: bool, /// Do not exit with error when pattern is unmatched #[arg(long = "no-error-on-unmatched-pattern")] no_error_on_unmatched_pattern: bool, 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..5afdf0b8a7 100644 --- a/packages/cli/snap-tests-global/command-check-help/snap.txt +++ b/packages/cli/snap-tests-global/command-check-help/snap.txt @@ -9,6 +9,7 @@ Options: --fix Auto-fix format and lint issues --no-fmt Skip format check --no-lint Skip lint check + --no-type-check Skip type check --no-error-on-unmatched-pattern Do not exit with error when pattern is unmatched -h, --help Print help @@ -31,6 +32,7 @@ Options: --fix Auto-fix format and lint issues --no-fmt Skip format check --no-lint Skip lint check + --no-type-check Skip type check --no-error-on-unmatched-pattern Do not exit with error when pattern is unmatched -h, --help Print help @@ -53,6 +55,7 @@ Options: --fix Auto-fix format and lint issues --no-fmt Skip format check --no-lint Skip lint check + --no-type-check Skip type check --no-error-on-unmatched-pattern Do not exit with error when pattern is unmatched -h, --help Print help From 733825970ad5e13c7d25c9c74215eb78fa45ebe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A2=85=EA=B2=BD?= Date: Sat, 18 Apr 2026 19:20:20 +0900 Subject: [PATCH 02/10] refactor(check): introduce LintMessageKind::TypeCheckOnly and from_flags --- packages/cli/binding/src/check/analysis.rs | 40 ++++++++++++++++++---- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/packages/cli/binding/src/check/analysis.rs b/packages/cli/binding/src/check/analysis.rs index 2dbaa00577..a7e1ce97be 100644 --- a/packages/cli/binding/src/check/analysis.rs +++ b/packages/cli/binding/src/check/analysis.rs @@ -39,23 +39,41 @@ pub(super) struct LintFailure { pub(super) enum LintMessageKind { LintOnly, LintAndTypeCheck, + // Used when lint rules are skipped but type-check still runs. + #[allow(dead_code)] + TypeCheckOnly, } impl LintMessageKind { pub(super) fn from_lint_config(lint_config: Option<&serde_json::Value>) -> Self { - let type_check_enabled = lint_config - .and_then(|config| config.get("options")) - .and_then(|options| options.get("typeCheck")) - .and_then(serde_json::Value::as_bool) - .unwrap_or(false); + if lint_config_type_check_enabled(lint_config) { + Self::LintAndTypeCheck + } else { + Self::LintOnly + } + } - if type_check_enabled { Self::LintAndTypeCheck } else { Self::LintOnly } + // Selects a variant from the `(lint, type-check)` enabled tuple callers have + // already resolved, avoiding a second config lookup inside the helper. + #[allow(dead_code)] + pub(super) fn from_flags(lint_enabled: bool, type_check_enabled: bool) -> Self { + match (lint_enabled, type_check_enabled) { + (true, true) => Self::LintAndTypeCheck, + (true, false) => Self::LintOnly, + (false, true) => Self::TypeCheckOnly, + (false, false) => { + unreachable!( + "from_flags called with (false, false) — caller must ensure lint or type-check runs before selecting a message kind" + ) + } + } } pub(super) fn success_label(self) -> &'static str { match self { Self::LintOnly => "Found no warnings or lint errors", Self::LintAndTypeCheck => "Found no warnings, lint errors, or type errors", + Self::TypeCheckOnly => "Found no type errors", } } @@ -63,6 +81,7 @@ impl LintMessageKind { match self { Self::LintOnly => "Lint warnings found", Self::LintAndTypeCheck => "Lint or type warnings found", + Self::TypeCheckOnly => "Type warnings found", } } @@ -70,10 +89,19 @@ impl LintMessageKind { match self { Self::LintOnly => "Lint issues found", Self::LintAndTypeCheck => "Lint or type issues found", + Self::TypeCheckOnly => "Type errors found", } } } +pub(super) fn lint_config_type_check_enabled(lint_config: Option<&serde_json::Value>) -> bool { + lint_config + .and_then(|config| config.get("options")) + .and_then(|options| options.get("typeCheck")) + .and_then(serde_json::Value::as_bool) + .unwrap_or(false) +} + fn parse_check_summary(line: &str) -> Option { let rest = line.strip_prefix("Finished in ")?; let (duration, rest) = rest.split_once(" on ")?; From 4e40a3fee61ce5104cd08306a7b72384b43f9dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A2=85=EA=B2=BD?= Date: Sat, 18 Apr 2026 19:23:06 +0900 Subject: [PATCH 03/10] feat(check): reject --fix --no-lint when typeCheck is enabled --- packages/cli/binding/src/check/mod.rs | 30 +++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/packages/cli/binding/src/check/mod.rs b/packages/cli/binding/src/check/mod.rs index 6777cc2c8a..33bd667e04 100644 --- a/packages/cli/binding/src/check/mod.rs +++ b/packages/cli/binding/src/check/mod.rs @@ -10,7 +10,8 @@ use vite_task::ExitStatus; use self::analysis::{ LintMessageKind, analyze_fmt_check_output, analyze_lint_output, format_count, format_elapsed, - print_error_block, print_pass_line, print_stdout_block, print_summary_line, + lint_config_type_check_enabled, print_error_block, print_pass_line, print_stdout_block, + print_summary_line, }; use crate::cli::{ CapturedCommandOutput, SubcommandResolver, SynthesizableSubcommand, resolve_and_capture_output, @@ -22,7 +23,7 @@ pub(crate) async fn execute_check( fix: bool, no_fmt: bool, no_lint: bool, - _no_type_check: bool, + no_type_check: bool, no_error_on_unmatched_pattern: bool, paths: Vec, envs: &Arc, Arc>>, @@ -47,6 +48,31 @@ pub(crate) async fn execute_check( let mut deferred_lint_pass: Option<(String, String)> = None; let resolved_vite_config = resolver.resolve_universal_vite_config().await?; + // Per-phase enabled booleans derived from the raw flags plus the resolved + // config's `typeCheck` setting. Currently only the guard immediately below + // reads these; the fmt/lint phase conditions further down still consult the + // raw `no_fmt`/`no_lint` flags. + let config_type_check_enabled = + lint_config_type_check_enabled(resolved_vite_config.lint.as_ref()); + let type_check_enabled = !no_type_check && config_type_check_enabled; + let lint_enabled = !no_lint; + + // Reject `--fix --no-lint` when the project enables type-check. With lint + // rules skipped, oxlint would take the type-check-only path which it + // itself refuses to combine with `--fix`. Running fmt first and then + // hitting that rejection would leave the working tree partially formatted + // (a real hazard inside lint-staged). Failing up-front keeps the + // invocation transactional. + if fix && !lint_enabled && type_check_enabled { + output::error( + "`vp check --fix --no-lint` cannot be combined with type-check enabled in config", + ); + print_summary_line( + "type-check diagnostics are read-only and cannot be auto-fixed. Add `--no-type-check` to format-only fix, or drop `--no-lint` to run lint fixes.", + ); + return Ok(ExitStatus(1)); + } + if !no_fmt { let mut args = if fix { vec![] } else { vec!["--check".to_string()] }; if suppress_unmatched { From 3dd0bf783ba3f613af83df928a9da2014e1b1019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A2=85=EA=B2=BD?= Date: Sat, 18 Apr 2026 19:44:42 +0900 Subject: [PATCH 04/10] feat(check): add .mjs sidecar helper for --no-type-check override --- packages/cli/binding/src/check/mod.rs | 1 + packages/cli/binding/src/check/sidecar.rs | 120 ++++++++++++++++++++++ packages/cli/binding/src/cli/mod.rs | 2 +- 3 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 packages/cli/binding/src/check/sidecar.rs diff --git a/packages/cli/binding/src/check/mod.rs b/packages/cli/binding/src/check/mod.rs index 33bd667e04..357049a41f 100644 --- a/packages/cli/binding/src/check/mod.rs +++ b/packages/cli/binding/src/check/mod.rs @@ -1,4 +1,5 @@ mod analysis; +mod sidecar; use std::{ffi::OsStr, sync::Arc, time::Instant}; diff --git a/packages/cli/binding/src/check/sidecar.rs b/packages/cli/binding/src/check/sidecar.rs new file mode 100644 index 0000000000..80469fcfc6 --- /dev/null +++ b/packages/cli/binding/src/check/sidecar.rs @@ -0,0 +1,120 @@ +//! Transient `.mjs` config that overrides `lint.options.typeCheck` to `false`. +//! +//! oxlint loads the `-c ` target with dynamic `import()` and reads +//! `.default.lint` when `VP_VERSION` is set (the vite-plus invocation path). +//! Writing a sidecar module with that shape lets a single invocation opt out +//! of type-check without mutating the project's `vite.config.ts`. + +use std::{ + fs, + sync::atomic::{AtomicU64, Ordering}, + time::{SystemTime, UNIX_EPOCH}, +}; + +use serde_json::Value; +use vite_error::Error; +use vite_path::AbsolutePathBuf; + +use crate::cli::ResolvedUniversalViteConfig; + +/// Override returned by [`write_no_type_check_sidecar`]. The `_guard` field +/// deletes the sidecar file on drop; callers must keep the override alive +/// until oxlint has finished reading the config. +pub(super) struct SidecarOverride { + pub(super) config: ResolvedUniversalViteConfig, + _guard: SidecarCleanup, +} + +struct SidecarCleanup { + path: AbsolutePathBuf, +} + +impl Drop for SidecarCleanup { + fn drop(&mut self) { + // Best-effort: ignore errors (file already gone, permission denied, etc.). + let _ = fs::remove_file(self.path.as_path()); + } +} + +static SIDECAR_COUNTER: AtomicU64 = AtomicU64::new(0); + +/// Write a sidecar `.mjs` that mirrors the project's lint config with +/// `options.typeCheck = false`, and return a clone of +/// `ResolvedUniversalViteConfig` pointing at the sidecar path. +/// +/// Returns `Ok(None)` when the resolved config lacks either a `configFile` or +/// a `lint` entry — there is nothing for the override to replace and the +/// caller should run lint unchanged. +/// +/// `typeAware` is intentionally untouched: the flag only disables type-check +/// (tsgolint), not type-aware lint rules. +pub(super) fn write_no_type_check_sidecar( + resolved_vite_config: &ResolvedUniversalViteConfig, +) -> Result, Error> { + if resolved_vite_config.config_file.is_none() { + return Ok(None); + } + let Some(lint) = resolved_vite_config.lint.as_ref() else { + return Ok(None); + }; + + let mut lint_clone: Value = lint.clone(); + let Some(options) = lint_clone.as_object_mut().and_then(|map| { + map.entry("options") + .or_insert_with(|| Value::Object(serde_json::Map::new())) + .as_object_mut() + }) else { + // Lint value isn't a JSON object — unexpected shape. Skip the + // override rather than guess at a structure. + return Ok(None); + }; + options.insert("typeCheck".to_string(), Value::Bool(false)); + + // Contract check: `resolveUniversalViteConfig` returns the lint subtree at + // the top level, so the clone must not be re-wrapped under another `lint` + // key. Enforced in release too — a regression here would silently empty + // the sidecar when oxlint reads `.default.lint`. + if lint_clone.get("lint").is_some() { + return Err(Error::Anyhow(anyhow::anyhow!( + "resolved lint config unexpectedly wrapped under another `lint` key" + ))); + } + + let pid = std::process::id(); + let nanos = SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_nanos()).unwrap_or(0); + let counter = SIDECAR_COUNTER.fetch_add(1, Ordering::Relaxed); + let filename = vite_str::format!("vite-plus-no-type-check-{pid}-{nanos}-{counter}.mjs"); + let filename_str: &str = filename.as_ref(); + let raw_temp_path = std::env::temp_dir().join(filename_str); + let sidecar_path = AbsolutePathBuf::new(raw_temp_path).ok_or_else(|| { + Error::Anyhow(anyhow::anyhow!("system temp dir resolved to a non-absolute path")) + })?; + + // `serde_json::to_string` quotes keys and escapes string values, producing + // output that is also a valid JS object literal on Node ≥ 10 (the minimum + // already required by vite-plus). + let lint_json = serde_json::to_string(&lint_clone).map_err(|e| { + Error::Anyhow(anyhow::anyhow!("failed to serialize lint config for sidecar: {e}")) + })?; + let content = vite_str::format!("export default {{ lint: {lint_json} }};\n"); + let content_str: &str = content.as_ref(); + + fs::write(sidecar_path.as_path(), content_str.as_bytes()).map_err(|e| { + Error::Anyhow(anyhow::anyhow!( + "failed to write sidecar at {}: {e}", + sidecar_path.as_path().display() + )) + })?; + + // Keep the override internally consistent: any future reader of + // `config.lint` (e.g., cache-key hashing, logging) will see the same + // `typeCheck: false` value that oxlint reads from the sidecar file. + let mut config_override = resolved_vite_config.clone(); + config_override.config_file = Some(sidecar_path.as_path().to_string_lossy().into_owned()); + config_override.lint = Some(lint_clone); + + Ok(Some(SidecarOverride { + config: config_override, + _guard: SidecarCleanup { path: sidecar_path }, + })) +} diff --git a/packages/cli/binding/src/cli/mod.rs b/packages/cli/binding/src/cli/mod.rs index 5f00d734cf..ff6e4252c1 100644 --- a/packages/cli/binding/src/cli/mod.rs +++ b/packages/cli/binding/src/cli/mod.rs @@ -17,11 +17,11 @@ pub(crate) use execution::resolve_and_capture_output; // Re-exports for lib.rs and check/mod.rs pub use resolver::SubcommandResolver; use rustc_hash::FxHashMap; -pub(crate) use types::CapturedCommandOutput; pub use types::{ BoxedResolverFn, CliOptions, ResolveCommandResult, SynthesizableSubcommand, ViteConfigResolverFn, }; +pub(crate) use types::{CapturedCommandOutput, ResolvedUniversalViteConfig}; use vite_error::Error; use vite_path::{AbsolutePath, AbsolutePathBuf}; pub use vite_shared::init_tracing; From c19ccc281ee8a728982c6029634b03bf397b9c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A2=85=EA=B2=BD?= Date: Sat, 18 Apr 2026 19:56:03 +0900 Subject: [PATCH 05/10] feat(check): wire lint phase to 3-phase matrix via from_flags and sidecar --- packages/cli/binding/src/check/analysis.rs | 41 ---------- packages/cli/binding/src/check/mod.rs | 75 +++++++++++++------ .../cli/snap-tests/check-all-skipped/snap.txt | 2 +- 3 files changed, 55 insertions(+), 63 deletions(-) diff --git a/packages/cli/binding/src/check/analysis.rs b/packages/cli/binding/src/check/analysis.rs index a7e1ce97be..f6bf501ca5 100644 --- a/packages/cli/binding/src/check/analysis.rs +++ b/packages/cli/binding/src/check/analysis.rs @@ -40,22 +40,12 @@ pub(super) enum LintMessageKind { LintOnly, LintAndTypeCheck, // Used when lint rules are skipped but type-check still runs. - #[allow(dead_code)] TypeCheckOnly, } impl LintMessageKind { - pub(super) fn from_lint_config(lint_config: Option<&serde_json::Value>) -> Self { - if lint_config_type_check_enabled(lint_config) { - Self::LintAndTypeCheck - } else { - Self::LintOnly - } - } - // Selects a variant from the `(lint, type-check)` enabled tuple callers have // already resolved, avoiding a second config lookup inside the helper. - #[allow(dead_code)] pub(super) fn from_flags(lint_enabled: bool, type_check_enabled: bool) -> Self { match (lint_enabled, type_check_enabled) { (true, true) => Self::LintAndTypeCheck, @@ -250,34 +240,3 @@ pub(super) fn analyze_lint_output(output: &str) -> Option, ) -> Result { - if no_fmt && no_lint { - output::error("No checks enabled"); - print_summary_line( - "`vp check` did not run because both `--no-fmt` and `--no-lint` were set", - ); - return Ok(ExitStatus(1)); - } - let mut status = ExitStatus::SUCCESS; let has_paths = !paths.is_empty(); // In --fix mode with file paths (the lint-staged use case), implicitly suppress @@ -50,13 +45,22 @@ pub(crate) async fn execute_check( let resolved_vite_config = resolver.resolve_universal_vite_config().await?; // Per-phase enabled booleans derived from the raw flags plus the resolved - // config's `typeCheck` setting. Currently only the guard immediately below - // reads these; the fmt/lint phase conditions further down still consult the - // raw `no_fmt`/`no_lint` flags. + // config's `typeCheck` setting. `run_lint_phase` drives whether the lint + // subprocess starts at all — true when lint rules should run, or when + // type-check should run via oxlint's type-check-only path. let config_type_check_enabled = lint_config_type_check_enabled(resolved_vite_config.lint.as_ref()); let type_check_enabled = !no_type_check && config_type_check_enabled; let lint_enabled = !no_lint; + let run_lint_phase = lint_enabled || type_check_enabled; + + if no_fmt && !run_lint_phase { + output::error("No checks enabled"); + print_summary_line( + "`vp check` did not run because all checks were disabled by the provided flags", + ); + return Ok(ExitStatus(1)); + } // Reject `--fix --no-lint` when the project enables type-check. With lint // rules skipped, oxlint would take the type-check-only path which it @@ -74,6 +78,18 @@ pub(crate) async fn execute_check( return Ok(ExitStatus(1)); } + // Build the `--no-type-check` sidecar up front, before any fmt side effects. + // If temp-dir write fails (full tmpfs, read-only mount, permission denied), + // we surface the error before fmt modifies files, mirroring the + // transactional guarantee of the hard-error guard above. The returned + // guard lives through both fmt and lint phases and is dropped at function + // exit, cleaning up the temp file. + let sidecar = if lint_enabled && no_type_check && config_type_check_enabled { + write_no_type_check_sidecar(&resolved_vite_config)? + } else { + None + }; + if !no_fmt { let mut args = if fix { vec![] } else { vec!["--check".to_string()] }; if suppress_unmatched { @@ -137,7 +153,7 @@ pub(crate) async fn execute_check( } } - if fix && no_lint && status == ExitStatus::SUCCESS { + if fix && !run_lint_phase && status == ExitStatus::SUCCESS { print_pass_line( "Formatting completed for checked files", Some(&format!("({})", format_elapsed(fmt_start.elapsed()))), @@ -155,13 +171,23 @@ pub(crate) async fn execute_check( } } - if !no_lint { - let lint_message_kind = - LintMessageKind::from_lint_config(resolved_vite_config.lint.as_ref()); + if run_lint_phase { + let lint_message_kind = LintMessageKind::from_flags(lint_enabled, type_check_enabled); let mut args = Vec::new(); - if fix { + // Hard-error guard above rejects (fix && !lint_enabled && type_check_enabled), + // so when this branch runs with `fix`, lint_enabled is always true. The + // `lint_enabled` check is defense-in-depth against future guard changes. + if fix && lint_enabled { args.push("--fix".to_string()); } + // `--type-check-only` suppresses lint rules and runs only type-check + // diagnostics. oxlint accepts this as a hidden flag (oxc#21184). When + // config `typeCheck` is false this flag forces type-check ON, so we + // only emit it on the `--no-lint` + `typeCheck: true` path and skip + // the lint phase entirely when type_check_enabled is false. + if !lint_enabled && type_check_enabled { + args.push("--type-check-only".to_string()); + } // `vp check` parses oxlint's human-readable summary output to print // unified pass/fail lines. When `GITHUB_ACTIONS=true`, oxlint auto-switches // to the GitHub reporter, which omits that summary on success and makes the @@ -174,10 +200,17 @@ pub(crate) async fn execute_check( if has_paths { args.extend(paths.iter().cloned()); } + + // `sidecar` was built up front to surface temp-dir write failures + // before fmt made any changes. Borrow its config here to route oxlint + // through the override when present; otherwise use the resolved + // config unchanged. + let lint_vite_config = sidecar.as_ref().map(|s| &s.config).unwrap_or(&resolved_vite_config); + let captured = resolve_and_capture_output( resolver, SynthesizableSubcommand::Lint { args }, - Some(&resolved_vite_config), + Some(lint_vite_config), envs, cwd, cwd_arc, diff --git a/packages/cli/snap-tests/check-all-skipped/snap.txt b/packages/cli/snap-tests/check-all-skipped/snap.txt index 99cea52dfb..a043e7f3e5 100644 --- a/packages/cli/snap-tests/check-all-skipped/snap.txt +++ b/packages/cli/snap-tests/check-all-skipped/snap.txt @@ -1,4 +1,4 @@ [1]> vp check --no-fmt --no-lint error: No checks enabled -`vp check` did not run because both `--no-fmt` and `--no-lint` were set +`vp check` did not run because all checks were disabled by the provided flags From 0cb82bf16ec7f753390595ed44810e6cb08d0677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A2=85=EA=B2=BD?= Date: Sat, 18 Apr 2026 19:58:30 +0900 Subject: [PATCH 06/10] test(check): add --no-type-check bypass fixture --- .../cli/snap-tests/check-no-type-check-pass/package.json | 5 +++++ packages/cli/snap-tests/check-no-type-check-pass/snap.txt | 3 +++ .../cli/snap-tests/check-no-type-check-pass/src/index.ts | 2 ++ .../cli/snap-tests/check-no-type-check-pass/steps.json | 6 ++++++ .../snap-tests/check-no-type-check-pass/vite.config.ts | 8 ++++++++ 5 files changed, 24 insertions(+) create mode 100644 packages/cli/snap-tests/check-no-type-check-pass/package.json create mode 100644 packages/cli/snap-tests/check-no-type-check-pass/snap.txt create mode 100644 packages/cli/snap-tests/check-no-type-check-pass/src/index.ts create mode 100644 packages/cli/snap-tests/check-no-type-check-pass/steps.json create mode 100644 packages/cli/snap-tests/check-no-type-check-pass/vite.config.ts diff --git a/packages/cli/snap-tests/check-no-type-check-pass/package.json b/packages/cli/snap-tests/check-no-type-check-pass/package.json new file mode 100644 index 0000000000..42a2d83c88 --- /dev/null +++ b/packages/cli/snap-tests/check-no-type-check-pass/package.json @@ -0,0 +1,5 @@ +{ + "name": "check-no-type-check-pass", + "version": "0.0.0", + "private": true +} diff --git a/packages/cli/snap-tests/check-no-type-check-pass/snap.txt b/packages/cli/snap-tests/check-no-type-check-pass/snap.txt new file mode 100644 index 0000000000..e6772955c0 --- /dev/null +++ b/packages/cli/snap-tests/check-no-type-check-pass/snap.txt @@ -0,0 +1,3 @@ +> vp check --no-type-check +pass: All 4 files are correctly formatted (ms, threads) +pass: Found no warnings or lint errors in 2 files (ms, threads) diff --git a/packages/cli/snap-tests/check-no-type-check-pass/src/index.ts b/packages/cli/snap-tests/check-no-type-check-pass/src/index.ts new file mode 100644 index 0000000000..21f1da94fe --- /dev/null +++ b/packages/cli/snap-tests/check-no-type-check-pass/src/index.ts @@ -0,0 +1,2 @@ +const value: number = "not a number"; +export { value }; diff --git a/packages/cli/snap-tests/check-no-type-check-pass/steps.json b/packages/cli/snap-tests/check-no-type-check-pass/steps.json new file mode 100644 index 0000000000..72bf1dbb08 --- /dev/null +++ b/packages/cli/snap-tests/check-no-type-check-pass/steps.json @@ -0,0 +1,6 @@ +{ + "env": { + "VITE_DISABLE_AUTO_INSTALL": "1" + }, + "commands": ["vp check --no-type-check"] +} diff --git a/packages/cli/snap-tests/check-no-type-check-pass/vite.config.ts b/packages/cli/snap-tests/check-no-type-check-pass/vite.config.ts new file mode 100644 index 0000000000..ecd9dc9d34 --- /dev/null +++ b/packages/cli/snap-tests/check-no-type-check-pass/vite.config.ts @@ -0,0 +1,8 @@ +export default { + lint: { + options: { + typeAware: true, + typeCheck: true, + }, + }, +}; From 9cb4ef7f7e7aa32e22262c0d9f1701e3c60a86d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A2=85=EA=B2=BD?= Date: Sat, 18 Apr 2026 19:59:10 +0900 Subject: [PATCH 07/10] test(check): add --no-lint type-check-only fixtures (pass and fail) --- .../check-type-check-only-fail/package.json | 5 +++++ .../snap-tests/check-type-check-only-fail/snap.txt | 11 +++++++++++ .../check-type-check-only-fail/src/index.ts | 2 ++ .../snap-tests/check-type-check-only-fail/steps.json | 6 ++++++ .../check-type-check-only-fail/vite.config.ts | 11 +++++++++++ .../check-type-check-only-pass/package.json | 5 +++++ .../snap-tests/check-type-check-only-pass/snap.txt | 3 +++ .../check-type-check-only-pass/src/index.ts | 2 ++ .../snap-tests/check-type-check-only-pass/steps.json | 6 ++++++ .../check-type-check-only-pass/vite.config.ts | 11 +++++++++++ 10 files changed, 62 insertions(+) create mode 100644 packages/cli/snap-tests/check-type-check-only-fail/package.json create mode 100644 packages/cli/snap-tests/check-type-check-only-fail/snap.txt create mode 100644 packages/cli/snap-tests/check-type-check-only-fail/src/index.ts create mode 100644 packages/cli/snap-tests/check-type-check-only-fail/steps.json create mode 100644 packages/cli/snap-tests/check-type-check-only-fail/vite.config.ts create mode 100644 packages/cli/snap-tests/check-type-check-only-pass/package.json create mode 100644 packages/cli/snap-tests/check-type-check-only-pass/snap.txt create mode 100644 packages/cli/snap-tests/check-type-check-only-pass/src/index.ts create mode 100644 packages/cli/snap-tests/check-type-check-only-pass/steps.json create mode 100644 packages/cli/snap-tests/check-type-check-only-pass/vite.config.ts diff --git a/packages/cli/snap-tests/check-type-check-only-fail/package.json b/packages/cli/snap-tests/check-type-check-only-fail/package.json new file mode 100644 index 0000000000..97bb2ffd94 --- /dev/null +++ b/packages/cli/snap-tests/check-type-check-only-fail/package.json @@ -0,0 +1,5 @@ +{ + "name": "check-type-check-only-fail", + "version": "0.0.0", + "private": true +} diff --git a/packages/cli/snap-tests/check-type-check-only-fail/snap.txt b/packages/cli/snap-tests/check-type-check-only-fail/snap.txt new file mode 100644 index 0000000000..d5266439a8 --- /dev/null +++ b/packages/cli/snap-tests/check-type-check-only-fail/snap.txt @@ -0,0 +1,11 @@ +[1]> vp check --no-lint +pass: All 4 files are correctly formatted (ms, threads) +error: Type errors found +× typescript(TS2322): Type 'string' is not assignable to type 'number'. + ╭─[src/index.ts:1:7] + 1 │ const value: number = "not a number"; + · ───── + 2 │ export { value }; + ╰──── + +Found 1 error and 0 warnings in 2 files (ms, threads) diff --git a/packages/cli/snap-tests/check-type-check-only-fail/src/index.ts b/packages/cli/snap-tests/check-type-check-only-fail/src/index.ts new file mode 100644 index 0000000000..21f1da94fe --- /dev/null +++ b/packages/cli/snap-tests/check-type-check-only-fail/src/index.ts @@ -0,0 +1,2 @@ +const value: number = "not a number"; +export { value }; diff --git a/packages/cli/snap-tests/check-type-check-only-fail/steps.json b/packages/cli/snap-tests/check-type-check-only-fail/steps.json new file mode 100644 index 0000000000..8f1a7ce30d --- /dev/null +++ b/packages/cli/snap-tests/check-type-check-only-fail/steps.json @@ -0,0 +1,6 @@ +{ + "env": { + "VITE_DISABLE_AUTO_INSTALL": "1" + }, + "commands": ["vp check --no-lint"] +} diff --git a/packages/cli/snap-tests/check-type-check-only-fail/vite.config.ts b/packages/cli/snap-tests/check-type-check-only-fail/vite.config.ts new file mode 100644 index 0000000000..76a798b58b --- /dev/null +++ b/packages/cli/snap-tests/check-type-check-only-fail/vite.config.ts @@ -0,0 +1,11 @@ +export default { + lint: { + options: { + typeAware: true, + typeCheck: true, + }, + rules: { + "no-eval": "error", + }, + }, +}; diff --git a/packages/cli/snap-tests/check-type-check-only-pass/package.json b/packages/cli/snap-tests/check-type-check-only-pass/package.json new file mode 100644 index 0000000000..467c05abdb --- /dev/null +++ b/packages/cli/snap-tests/check-type-check-only-pass/package.json @@ -0,0 +1,5 @@ +{ + "name": "check-type-check-only-pass", + "version": "0.0.0", + "private": true +} diff --git a/packages/cli/snap-tests/check-type-check-only-pass/snap.txt b/packages/cli/snap-tests/check-type-check-only-pass/snap.txt new file mode 100644 index 0000000000..469b0db71e --- /dev/null +++ b/packages/cli/snap-tests/check-type-check-only-pass/snap.txt @@ -0,0 +1,3 @@ +> vp check --no-lint +pass: All 4 files are correctly formatted (ms, threads) +pass: Found no type errors in 2 files (ms, threads) diff --git a/packages/cli/snap-tests/check-type-check-only-pass/src/index.ts b/packages/cli/snap-tests/check-type-check-only-pass/src/index.ts new file mode 100644 index 0000000000..3b3d6d4fbc --- /dev/null +++ b/packages/cli/snap-tests/check-type-check-only-pass/src/index.ts @@ -0,0 +1,2 @@ +const value: number = 42; +export { value }; diff --git a/packages/cli/snap-tests/check-type-check-only-pass/steps.json b/packages/cli/snap-tests/check-type-check-only-pass/steps.json new file mode 100644 index 0000000000..8f1a7ce30d --- /dev/null +++ b/packages/cli/snap-tests/check-type-check-only-pass/steps.json @@ -0,0 +1,6 @@ +{ + "env": { + "VITE_DISABLE_AUTO_INSTALL": "1" + }, + "commands": ["vp check --no-lint"] +} diff --git a/packages/cli/snap-tests/check-type-check-only-pass/vite.config.ts b/packages/cli/snap-tests/check-type-check-only-pass/vite.config.ts new file mode 100644 index 0000000000..76a798b58b --- /dev/null +++ b/packages/cli/snap-tests/check-type-check-only-pass/vite.config.ts @@ -0,0 +1,11 @@ +export default { + lint: { + options: { + typeAware: true, + typeCheck: true, + }, + rules: { + "no-eval": "error", + }, + }, +}; From 5f92061811332658ba583f7f721c78e6ea34dabc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A2=85=EA=B2=BD?= Date: Sat, 18 Apr 2026 20:00:46 +0900 Subject: [PATCH 08/10] test(check): add fmt-only and all-skipped guard fixtures --- .../cli/snap-tests/check-all-three-skipped/package.json | 5 +++++ packages/cli/snap-tests/check-all-three-skipped/snap.txt | 4 ++++ .../cli/snap-tests/check-all-three-skipped/src/index.ts | 1 + .../cli/snap-tests/check-all-three-skipped/steps.json | 6 ++++++ .../cli/snap-tests/check-all-three-skipped/vite.config.ts | 8 ++++++++ .../check-no-lint-no-typecheck-fmt-only/package.json | 5 +++++ .../check-no-lint-no-typecheck-fmt-only/snap.txt | 2 ++ .../check-no-lint-no-typecheck-fmt-only/src/index.ts | 2 ++ .../check-no-lint-no-typecheck-fmt-only/steps.json | 6 ++++++ .../check-no-lint-no-typecheck-fmt-only/vite.config.ts | 8 ++++++++ 10 files changed, 47 insertions(+) create mode 100644 packages/cli/snap-tests/check-all-three-skipped/package.json create mode 100644 packages/cli/snap-tests/check-all-three-skipped/snap.txt create mode 100644 packages/cli/snap-tests/check-all-three-skipped/src/index.ts create mode 100644 packages/cli/snap-tests/check-all-three-skipped/steps.json create mode 100644 packages/cli/snap-tests/check-all-three-skipped/vite.config.ts create mode 100644 packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/package.json create mode 100644 packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/snap.txt create mode 100644 packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/src/index.ts create mode 100644 packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/steps.json create mode 100644 packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/vite.config.ts diff --git a/packages/cli/snap-tests/check-all-three-skipped/package.json b/packages/cli/snap-tests/check-all-three-skipped/package.json new file mode 100644 index 0000000000..7efe63ebd4 --- /dev/null +++ b/packages/cli/snap-tests/check-all-three-skipped/package.json @@ -0,0 +1,5 @@ +{ + "name": "check-all-three-skipped", + "version": "0.0.0", + "private": true +} diff --git a/packages/cli/snap-tests/check-all-three-skipped/snap.txt b/packages/cli/snap-tests/check-all-three-skipped/snap.txt new file mode 100644 index 0000000000..e284f01f1b --- /dev/null +++ b/packages/cli/snap-tests/check-all-three-skipped/snap.txt @@ -0,0 +1,4 @@ +[1]> vp check --no-fmt --no-lint --no-type-check +error: No checks enabled + +`vp check` did not run because all checks were disabled by the provided flags diff --git a/packages/cli/snap-tests/check-all-three-skipped/src/index.ts b/packages/cli/snap-tests/check-all-three-skipped/src/index.ts new file mode 100644 index 0000000000..46d3ca8c61 --- /dev/null +++ b/packages/cli/snap-tests/check-all-three-skipped/src/index.ts @@ -0,0 +1 @@ +export const value = 42; diff --git a/packages/cli/snap-tests/check-all-three-skipped/steps.json b/packages/cli/snap-tests/check-all-three-skipped/steps.json new file mode 100644 index 0000000000..4edcc32955 --- /dev/null +++ b/packages/cli/snap-tests/check-all-three-skipped/steps.json @@ -0,0 +1,6 @@ +{ + "env": { + "VITE_DISABLE_AUTO_INSTALL": "1" + }, + "commands": ["vp check --no-fmt --no-lint --no-type-check"] +} diff --git a/packages/cli/snap-tests/check-all-three-skipped/vite.config.ts b/packages/cli/snap-tests/check-all-three-skipped/vite.config.ts new file mode 100644 index 0000000000..ecd9dc9d34 --- /dev/null +++ b/packages/cli/snap-tests/check-all-three-skipped/vite.config.ts @@ -0,0 +1,8 @@ +export default { + lint: { + options: { + typeAware: true, + typeCheck: true, + }, + }, +}; diff --git a/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/package.json b/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/package.json new file mode 100644 index 0000000000..ed5fa4586e --- /dev/null +++ b/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/package.json @@ -0,0 +1,5 @@ +{ + "name": "check-no-lint-no-typecheck-fmt-only", + "version": "0.0.0", + "private": true +} diff --git a/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/snap.txt b/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/snap.txt new file mode 100644 index 0000000000..1ad33e0f0c --- /dev/null +++ b/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/snap.txt @@ -0,0 +1,2 @@ +> vp check --no-lint --no-type-check +pass: All 4 files are correctly formatted (ms, threads) diff --git a/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/src/index.ts b/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/src/index.ts new file mode 100644 index 0000000000..21f1da94fe --- /dev/null +++ b/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/src/index.ts @@ -0,0 +1,2 @@ +const value: number = "not a number"; +export { value }; diff --git a/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/steps.json b/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/steps.json new file mode 100644 index 0000000000..50082f32c9 --- /dev/null +++ b/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/steps.json @@ -0,0 +1,6 @@ +{ + "env": { + "VITE_DISABLE_AUTO_INSTALL": "1" + }, + "commands": ["vp check --no-lint --no-type-check"] +} diff --git a/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/vite.config.ts b/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/vite.config.ts new file mode 100644 index 0000000000..ecd9dc9d34 --- /dev/null +++ b/packages/cli/snap-tests/check-no-lint-no-typecheck-fmt-only/vite.config.ts @@ -0,0 +1,8 @@ +export default { + lint: { + options: { + typeAware: true, + typeCheck: true, + }, + }, +}; From 751d26b6b0ba0ad5069d5634cc919271948ca7d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A2=85=EA=B2=BD?= Date: Sat, 18 Apr 2026 20:01:29 +0900 Subject: [PATCH 09/10] test(check): add --fix --no-lint hard error and corrective path fixtures --- .../check-fix-no-lint-no-typecheck/package.json | 5 +++++ .../snap-tests/check-fix-no-lint-no-typecheck/snap.txt | 2 ++ .../check-fix-no-lint-no-typecheck/src/index.ts | 1 + .../snap-tests/check-fix-no-lint-no-typecheck/steps.json | 6 ++++++ .../check-fix-no-lint-no-typecheck/vite.config.ts | 8 ++++++++ .../check-fix-no-lint-typecheck-error/package.json | 5 +++++ .../snap-tests/check-fix-no-lint-typecheck-error/snap.txt | 4 ++++ .../check-fix-no-lint-typecheck-error/src/index.ts | 1 + .../check-fix-no-lint-typecheck-error/steps.json | 6 ++++++ .../check-fix-no-lint-typecheck-error/vite.config.ts | 8 ++++++++ .../cli/snap-tests/check-fix-no-type-check/package.json | 5 +++++ packages/cli/snap-tests/check-fix-no-type-check/snap.txt | 3 +++ .../cli/snap-tests/check-fix-no-type-check/src/index.ts | 2 ++ .../cli/snap-tests/check-fix-no-type-check/steps.json | 6 ++++++ .../cli/snap-tests/check-fix-no-type-check/vite.config.ts | 8 ++++++++ 15 files changed, 70 insertions(+) create mode 100644 packages/cli/snap-tests/check-fix-no-lint-no-typecheck/package.json create mode 100644 packages/cli/snap-tests/check-fix-no-lint-no-typecheck/snap.txt create mode 100644 packages/cli/snap-tests/check-fix-no-lint-no-typecheck/src/index.ts create mode 100644 packages/cli/snap-tests/check-fix-no-lint-no-typecheck/steps.json create mode 100644 packages/cli/snap-tests/check-fix-no-lint-no-typecheck/vite.config.ts create mode 100644 packages/cli/snap-tests/check-fix-no-lint-typecheck-error/package.json create mode 100644 packages/cli/snap-tests/check-fix-no-lint-typecheck-error/snap.txt create mode 100644 packages/cli/snap-tests/check-fix-no-lint-typecheck-error/src/index.ts create mode 100644 packages/cli/snap-tests/check-fix-no-lint-typecheck-error/steps.json create mode 100644 packages/cli/snap-tests/check-fix-no-lint-typecheck-error/vite.config.ts create mode 100644 packages/cli/snap-tests/check-fix-no-type-check/package.json create mode 100644 packages/cli/snap-tests/check-fix-no-type-check/snap.txt create mode 100644 packages/cli/snap-tests/check-fix-no-type-check/src/index.ts create mode 100644 packages/cli/snap-tests/check-fix-no-type-check/steps.json create mode 100644 packages/cli/snap-tests/check-fix-no-type-check/vite.config.ts diff --git a/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/package.json b/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/package.json new file mode 100644 index 0000000000..ad1e97c11a --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/package.json @@ -0,0 +1,5 @@ +{ + "name": "check-fix-no-lint-no-typecheck", + "version": "0.0.0", + "private": true +} diff --git a/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/snap.txt b/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/snap.txt new file mode 100644 index 0000000000..5dde3d548e --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/snap.txt @@ -0,0 +1,2 @@ +> vp check --fix --no-lint --no-type-check +pass: Formatting completed for checked files (ms) diff --git a/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/src/index.ts b/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/src/index.ts new file mode 100644 index 0000000000..46d3ca8c61 --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/src/index.ts @@ -0,0 +1 @@ +export const value = 42; diff --git a/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/steps.json b/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/steps.json new file mode 100644 index 0000000000..2188f9ff3d --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/steps.json @@ -0,0 +1,6 @@ +{ + "env": { + "VITE_DISABLE_AUTO_INSTALL": "1" + }, + "commands": ["vp check --fix --no-lint --no-type-check"] +} diff --git a/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/vite.config.ts b/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/vite.config.ts new file mode 100644 index 0000000000..ecd9dc9d34 --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-lint-no-typecheck/vite.config.ts @@ -0,0 +1,8 @@ +export default { + lint: { + options: { + typeAware: true, + typeCheck: true, + }, + }, +}; diff --git a/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/package.json b/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/package.json new file mode 100644 index 0000000000..f5c39f479b --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/package.json @@ -0,0 +1,5 @@ +{ + "name": "check-fix-no-lint-typecheck-error", + "version": "0.0.0", + "private": true +} diff --git a/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/snap.txt b/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/snap.txt new file mode 100644 index 0000000000..da7382c403 --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/snap.txt @@ -0,0 +1,4 @@ +[1]> vp check --fix --no-lint +error: `vp check --fix --no-lint` cannot be combined with type-check enabled in config + +type-check diagnostics are read-only and cannot be auto-fixed. Add `--no-type-check` to format-only fix, or drop `--no-lint` to run lint fixes. diff --git a/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/src/index.ts b/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/src/index.ts new file mode 100644 index 0000000000..46d3ca8c61 --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/src/index.ts @@ -0,0 +1 @@ +export const value = 42; diff --git a/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/steps.json b/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/steps.json new file mode 100644 index 0000000000..68a47942e1 --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/steps.json @@ -0,0 +1,6 @@ +{ + "env": { + "VITE_DISABLE_AUTO_INSTALL": "1" + }, + "commands": ["vp check --fix --no-lint"] +} diff --git a/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/vite.config.ts b/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/vite.config.ts new file mode 100644 index 0000000000..ecd9dc9d34 --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-lint-typecheck-error/vite.config.ts @@ -0,0 +1,8 @@ +export default { + lint: { + options: { + typeAware: true, + typeCheck: true, + }, + }, +}; diff --git a/packages/cli/snap-tests/check-fix-no-type-check/package.json b/packages/cli/snap-tests/check-fix-no-type-check/package.json new file mode 100644 index 0000000000..85134b94df --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-type-check/package.json @@ -0,0 +1,5 @@ +{ + "name": "check-fix-no-type-check", + "version": "0.0.0", + "private": true +} diff --git a/packages/cli/snap-tests/check-fix-no-type-check/snap.txt b/packages/cli/snap-tests/check-fix-no-type-check/snap.txt new file mode 100644 index 0000000000..5cebb98da5 --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-type-check/snap.txt @@ -0,0 +1,3 @@ +> vp check --fix --no-type-check +pass: Formatting completed for checked files (ms) +pass: Found no warnings or lint errors in 2 files (ms, threads) diff --git a/packages/cli/snap-tests/check-fix-no-type-check/src/index.ts b/packages/cli/snap-tests/check-fix-no-type-check/src/index.ts new file mode 100644 index 0000000000..21f1da94fe --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-type-check/src/index.ts @@ -0,0 +1,2 @@ +const value: number = "not a number"; +export { value }; diff --git a/packages/cli/snap-tests/check-fix-no-type-check/steps.json b/packages/cli/snap-tests/check-fix-no-type-check/steps.json new file mode 100644 index 0000000000..59f40d8bc0 --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-type-check/steps.json @@ -0,0 +1,6 @@ +{ + "env": { + "VITE_DISABLE_AUTO_INSTALL": "1" + }, + "commands": ["vp check --fix --no-type-check"] +} diff --git a/packages/cli/snap-tests/check-fix-no-type-check/vite.config.ts b/packages/cli/snap-tests/check-fix-no-type-check/vite.config.ts new file mode 100644 index 0000000000..ecd9dc9d34 --- /dev/null +++ b/packages/cli/snap-tests/check-fix-no-type-check/vite.config.ts @@ -0,0 +1,8 @@ +export default { + lint: { + options: { + typeAware: true, + typeCheck: true, + }, + }, +}; From e835c07184c5a54e2f84f3d6013713dbff63a411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A2=85=EA=B2=BD?= Date: Sat, 18 Apr 2026 20:06:10 +0900 Subject: [PATCH 10/10] docs(check): document phase skip flags --- docs/guide/check.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/guide/check.md b/docs/guide/check.md index 1f5b984e1c..a6548b3343 100644 --- a/docs/guide/check.md +++ b/docs/guide/check.md @@ -17,6 +17,16 @@ vp check vp check --fix # Format and run autofixers. ``` +## Phase skip flags + +`vp check` runs three phases — format, lint rules, and type check — all enabled by default. Each phase can be skipped independently: + +| Flag | Skips | +| ---- | ----- | +| `--no-fmt` | Format check | +| `--no-lint` | Lint rules (type check still runs if enabled in config) | +| `--no-type-check` | Type check | + ## Configuration `vp check` uses the same configuration you already define for linting and formatting: