Skip to content

feat(cli): add vp check command for format, lint, and type checks#643

Merged
fengmk2 merged 12 commits intomainfrom
vp-check-command
Feb 27, 2026
Merged

feat(cli): add vp check command for format, lint, and type checks#643
fengmk2 merged 12 commits intomainfrom
vp-check-command

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Feb 26, 2026

Add vp check as a built-in composite command that runs vp fmt --check
then vp lint --type-aware --type-check sequentially with fail-fast
semantics. Supports --no-fmt, --no-lint, --no-type-aware, and
--no-type-check flags to selectively disable checks.

This is the first composite command in vite-plus — all existing built-in
commands delegate to a single underlying tool.

@fengmk2 fengmk2 self-assigned this Feb 26, 2026
Copy link
Copy Markdown
Member Author

fengmk2 commented Feb 26, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

Comment thread rfcs/check-command.md
Comment thread rfcs/check-command.md Outdated
Copy link
Copy Markdown
Member

@cpojer cpojer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super cool! Good first version.

@fengmk2 fengmk2 force-pushed the vp-check-command branch 2 times, most recently from 63315d5 to 5c5fb42 Compare February 27, 2026 07:50
@fengmk2 fengmk2 marked this pull request as ready for review February 27, 2026 08:39
Copy link
Copy Markdown
Member

@cpojer cpojer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Copy Markdown
Member Author

fengmk2 commented Feb 27, 2026

Merge activity

  • Feb 27, 8:57 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 27, 8:58 AM UTC: Graphite rebased this pull request as part of a merge.
  • Feb 27, 9:06 AM UTC: Graphite rebased this pull request as part of a merge.
  • Feb 27, 9:23 AM UTC: Graphite rebased this pull request as part of a merge.
  • Feb 27, 9:37 AM UTC: @fengmk2 merged this pull request with Graphite.

@fengmk2 fengmk2 force-pushed the vp-check-command branch 2 times, most recently from 2338348 to 24ac4c8 Compare February 27, 2026 09:05
Add `vp check` as a built-in composite command that runs `vp fmt --check`
then `vp lint --type-aware --type-check` sequentially with fail-fast
semantics. Supports `--no-fmt`, `--no-lint`, `--no-type-aware`, and
`--no-type-check` flags to selectively disable checks.

This is the first composite command in vite-plus — all existing built-in
commands delegate to a single underlying tool.
tsgolint does not yet recognize Array#toSorted() from ES2023 lib,
causing TS2550 errors under `vp check`. Both call sites sort freshly
created arrays so in-place sort() is safe.
`vp check --fix` runs `vp fmt` (auto-format) then
`vp lint --fix --type-aware --type-check` (auto-fix lint issues),
replacing the manual `vp fmt && vp lint --fix` workflow.

Also removes unused `create_install_synthetic_request` function.
Lint fixes (e.g. curly rule adding braces) can break formatting.
Now `vp check --fix` runs: fmt → lint --fix → fmt, so a subsequent
`vp check` always passes.

Add check-fix-reformat snap test to verify the curly rule scenario.
Add trailing file path arguments to `vp check` so lint-staged can pass
staged files directly (e.g., `vp check --fix src/a.ts src/b.ts`).

When paths are provided:
- fmt receives `--no-error-on-unmatched-pattern` + paths
- lint receives paths directly
- The post-lint reformat step also receives the same flags

Simplify lint-staged config from two separate commands to a single
`vp check --fix`.
@fengmk2 fengmk2 merged commit 61d318d into main Feb 27, 2026
34 checks passed
@fengmk2 fengmk2 deleted the vp-check-command branch February 27, 2026 09:37
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.

3 participants