Skip to content

feat(check): add --type-check-only flag#1387

Closed
jong-kyung wants to merge 2 commits intovoidzero-dev:mainfrom
jong-kyung:feat/check-type-check-only
Closed

feat(check): add --type-check-only flag#1387
jong-kyung wants to merge 2 commits intovoidzero-dev:mainfrom
jong-kyung:feat/check-type-check-only

Conversation

@jong-kyung
Copy link
Copy Markdown
Collaborator

@jong-kyung jong-kyung commented Apr 15, 2026

Summary

Closes #1275

Adds vp check --type-check-only, which skips format and lint rules and runs only type checking via oxlint's --type-check-only (v1.60.0, upstream oxc-project/oxc#21184). Useful after large-scale changes where fixing type errors first resolves most downstream lint errors.

vp check --type-check-only
vp check --type-check-only src/

Behavior

  • Skips the fmt phase entirely and forwards --type-check-only to oxlint in the lint phase.
  • Forces type checking regardless of lint.options.typeCheck in vite.config.ts (oxlint internally enables both type_aware and type_check).
  • New LintMessageKind::TypeCheckOnly produces type-specific output ("Found no type errors" / "Type errors found").
  • Rejects --type-check-only --fix (type diagnostics have no auto-fixer; oxlint also rejects) and --type-check-only --no-lint (type checking runs in the lint phase) before spawning any subprocess.
  • --type-check-only --no-fmt is allowed (redundant no-op).

Tests

Five snap cases cover happy path, error path, typeCheck: false override, and both conflict flags, plus the global vp check -h snap is refreshed. Two unit tests cover the new LintMessageKind variant.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 15, 2026

👷 Deploy Preview for viteplus-preview processing.

Name Link
🔨 Latest commit e38ca19
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69df045f1239cb0008728ebe

@jong-kyung
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Adds `vp check --type-check-only` which skips format and lint rules and
runs only type checking via oxlint's new `--type-check-only` flag
(available since oxlint v1.60.0).

- Introduces `LintMessageKind::TypeCheckOnly` for type-check-only output
  ("Found no type errors" / "Type errors found")
- Forwards `--type-check-only` to oxlint in the lint phase and skips the
  fmt phase entirely
- Rejects `--type-check-only --no-lint` and `--type-check-only --fix`
  with a clear conflict message
- Updates the global CLI help for `vp check`
Five local cases cover the new flag's behaviors, plus the global
`vp check -h` snap is refreshed to include the new flag row:

- pass: no type errors with typeCheck enabled ("Found no type errors")
- fail: type error with typeCheck enabled surfaces TS2322 via tsgolint
- no-typecheck-config: `lint.options.typeCheck: false` does not suppress
  type errors when the flag is set
- conflict-fix: `--type-check-only --fix` rejected with a clear message
- conflict-no-lint: `--type-check-only --no-lint` rejected likewise

oxlint's `--type-check-only` output uses the same
"Found N error and M warning ... Finished in ..." summary that the
existing analyze_lint_output parser handles, so no parser changes are
needed.
@jong-kyung jong-kyung force-pushed the feat/check-type-check-only branch from bc5706c to e38ca19 Compare April 15, 2026 03:22
@jong-kyung
Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 15, 2026

Skipping Bugbot: Unable to authenticate your request. Please make sure Bugbot is properly installed and configured for this repository.

@jong-kyung
Copy link
Copy Markdown
Collaborator Author

If there are no issues with this PR, I'll resolve the conflicts in the main branch.

@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 15, 2026

@jong-kyung please fix conflicts first, I will start review when I have time.

@jong-kyung jong-kyung mentioned this pull request Apr 15, 2026
3 tasks
@jong-kyung
Copy link
Copy Markdown
Collaborator Author

Closing in favor of the direction confirmed in #1275 — reusing existing flags

@jong-kyung jong-kyung closed this Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add vp typecheck command

2 participants