feat(check): add --type-check-only flag#1387
Closed
jong-kyung wants to merge 2 commits intovoidzero-dev:mainfrom
Closed
feat(check): add --type-check-only flag#1387jong-kyung wants to merge 2 commits intovoidzero-dev:mainfrom
--type-check-only flag#1387jong-kyung wants to merge 2 commits intovoidzero-dev:mainfrom
Conversation
👷 Deploy Preview for viteplus-preview processing.
|
Collaborator
Author
|
@codex review |
|
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.
bc5706c to
e38ca19
Compare
Collaborator
Author
|
@cursor review |
|
Skipping Bugbot: Unable to authenticate your request. Please make sure Bugbot is properly installed and configured for this repository. |
Collaborator
Author
|
If there are no issues with this PR, I'll resolve the conflicts in the main branch. |
Member
|
@jong-kyung please fix conflicts first, I will start review when I have time. |
Collaborator
Author
|
Closing in favor of the direction confirmed in #1275 — reusing existing flags |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.Behavior
--type-check-onlyto oxlint in the lint phase.lint.options.typeCheckinvite.config.ts(oxlint internally enables bothtype_awareandtype_check).LintMessageKind::TypeCheckOnlyproduces type-specific output ("Found no type errors" / "Type errors found").--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-fmtis allowed (redundant no-op).Tests
Five snap cases cover happy path, error path,
typeCheck: falseoverride, and both conflict flags, plus the globalvp check -hsnap is refreshed. Two unit tests cover the newLintMessageKindvariant.