Skip to content

Commit effa3a5

Browse files
committed
perf(check): defer resolve_universal_vite_config to the lint branch
The resolved config is now only consumed by LintMessageKind, so calling the JS-runtime resolver unconditionally wasted a NAPI round-trip on `vp check --no-lint` and fmt-only paths.
1 parent 19480c6 commit effa3a5

File tree

1 file changed

+1
-1
lines changed
  • packages/cli/binding/src/check

1 file changed

+1
-1
lines changed

packages/cli/binding/src/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ pub(crate) async fn execute_check(
4545
let suppress_unmatched = no_error_on_unmatched_pattern || (fix && has_paths);
4646
let mut fmt_fix_started: Option<Instant> = None;
4747
let mut deferred_lint_pass: Option<(String, String)> = None;
48-
let resolved_vite_config = resolver.resolve_universal_vite_config().await?;
4948

5049
if !no_fmt {
5150
let mut args = if fix { vec![] } else { vec!["--check".to_string()] };
@@ -128,6 +127,7 @@ pub(crate) async fn execute_check(
128127
}
129128

130129
if !no_lint {
130+
let resolved_vite_config = resolver.resolve_universal_vite_config().await?;
131131
let lint_message_kind =
132132
LintMessageKind::from_lint_config(resolved_vite_config.lint.as_ref());
133133
let mut args = Vec::new();

0 commit comments

Comments
 (0)