Skip to content

Add vp typecheck command #1275

Closed as not planned
Closed as not planned

Description

@mizdra

Description

After certain changes, a large number of type errors and lint errors can appear in the codebase at once.

  • When adding noUncheckedIndexedAccess to tsconfig.json
  • When doing a bulk find-and-replace across the codebase

In these situations, it's more efficient to fix type errors first. Type errors can cause lint errors, so fixing them may resolve lint errors automatically. By fixing type errors first and lint errors second, you can reduce the overall amount of work.

Suggested solution

To support this workflow, I'd like a vp typecheck command — a command that runs only type checking, without format or lint.

Alternative

One workaround is to use vp exec tsgo. While this works, having a dedicated command would be more approachable for beginners.

Additional context

There is already a vp lint command. By default it runs only lint, but setting lint.options.typeCheck to true also runs type checking alongside lint. So the current behavior is:

  • When lint.options.typeCheck is true:
    • vp check: runs format, lint, and type check
    • vp format: runs format only
    • vp lint: runs lint and type check
    • vp typecheck: runs type check only
  • When lint.options.typeCheck is false:
    • vp check: runs format, lint, and type check
    • vp format: runs format only
    • vp lint: runs lint only
    • vp typecheck: runs type check only

Since vp format runs only format and vp typecheck would run only type check, users would naturally expect vp lint to run only lint as well. Having vp lint run more than just lint when lint.options.typeCheck: true feels inconsistent and unintuitive.

Here are some possible ways to address this, though each comes with trade-offs:

  • Deprecate the lint.options.typeCheck option and make vp lint always run lint only. However, this would be a breaking change for existing users.
  • Add a --type-check flag to vp lint so users can opt in to type checking via the command line. However, the interaction with lint.options.typeCheck: false may be confusing.

I'd love to hear if there are better ideas for solving this.

Validations

  • Read the Contributing Guidelines.
  • Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
  • Check that there isn't already an issue requesting the same feature.

Activity

  1. added theissue type on Apr 2, 2026
  2. mizdra commented on Apr 2, 2026

    @mizdra
    Author

    Thinking about this further, there are some open questions:

    • Which files should vp typecheck check?
      • All files, or only those included in tsconfig.json?
      • For reference, vp lint runs type checking only on the files targeted by lint.
    • Should the tsconfig.json path be configurable?
      • For example, via vp typecheck --project tsconfig.typecheck.json.
      • Should it be a CLI flag like --project, or a config option like typeCheck.options.project in vite.config.ts?

    These questions suggest that a full vp typecheck command could be a fairly large undertaking.

    Stepping back to why I wanted vp typecheck in the first place: my real pain point is that lint errors are mixed together in the output of vp lint. If there were a way to suppress lint errors from vp lint output, that would already satisfy my needs. So a simpler solution might be to just add a --type-check-only flag to vp lint.

  3. fengmk2 commented on Apr 2, 2026

    @fengmk2
    Member

    Consider adding a --type-only option to vp check https://viteplus.dev/guide/check? cc @cpojer what do you think?

  4. cpojer commented on Apr 2, 2026

    @cpojer
    Member

    I agree that a flag is better. I think --type-check-only is the most descriptive for this specific use case.

  5. self-assigned this
    on Apr 3, 2026
  6. jong-kyung commented on Apr 3, 2026

    @jong-kyung
    Collaborator

    @fengmk2 Hi! I would like to work on this issue. Could you assign it to me?

  7. kazupon commented on Apr 3, 2026

    @kazupon
    Collaborator

    I think that, in that case, shouldn’t we add --fmt-only and --lint-only too? 🤔

    If only --type-check is available, people tend to assume that there are standalone options like these, and they often end up wanting them.

  8. fengmk2 commented on Apr 3, 2026

    @fengmk2
    Member

    I suddenly remembered that oxlint doesn't have the "type check only" feature, right? @camc314

  9. cpojer commented on Apr 3, 2026

    @cpojer
    Member

    Since we already have --no-fmt and --no-lint, it might be better not to add any *-only flags. Instead, maybe we could find a good name for type checks but no lints, or redefine --no-lint to keep running type checks, and require --no-type-check to disable lint and type-check. Then vp check --no-lint would work for this use case.

  10. 13 remaining items

  11. fengmk2 commented on Apr 15, 2026

    @fengmk2
    Member

    @jong-kyung Yes, so we can take this opportunity to expand the complete functional description of the vp check command, which includes 3 core functions: format, lint, and type check. All are enabled by default, and can be individually disabled through these 3 flag parameters.

    Resulting behavior

    Command fmt lint type-check
    vp check ✓ ✓ ✓
    vp check --no-lint ✓ ✗ ✓ (type-check-only use case)
    vp check --no-type-check ✓ ✓ ✗
    vp check --no-lint --no-type-check ✓ ✗ ✗
    vp check --no-fmt ✗ ✓ ✓

    Rationale

    • Consistent with existing --no-fmt / --no-lint conventions.
    • Treats type-check as a first-class, independently toggleable concern.
    • vp check --no-lint naturally expresses the "type-check only" use case that motivated the issue.
  12. jong-kyung commented on Apr 15, 2026

    @jong-kyung
    Collaborator

    @fengmk2 Thanks! I've closed #1387 and will rework it along the proposed direction.

  13. added a commit that references this issue on Apr 23, 2026
    34ac221
  14. alexgagnon commented on Jul 22, 2026

    @alexgagnon

    If I may add a use case to support this work, I'm trying to have a PostToolUse hook that runs vp check on any supported file that's been touched by an agent. I believe that if I have typeCheck: true in my lint config, and if my tsconfig.json doesn't set isolatedDeclarations to true, then depending on what's cached, it might be re-running the whole type check per file edit (this is from my limited understanding, and which may or may not be wanted). The --no-type-check might help with this?

  15. liangmiQwQ commented on Oct 29, 2026

    @liangmiQwQ
    Collaborator

    @KTrain5169 proposed to reconsider a separate vp typecheck (alias: vp tc) command.

    #2735 already showed the current approach has limitation when users wanna run typecheck separately, not bound with vp check and vp lint.

    Regarding the previously discussed configuration and project boundary issues, I don't think things will actually be that complex, vp typecheck should be based directly on oxlint --type-check-only, rather than underlying tsgo or tsc.

    Context: https://discord.com/channels/1475973262193459293/1479410337223802951/1565356869017673852

    cc @fengmk2 and @cpojer

  16. voidzero-bot commented on Oct 29, 2026

    @voidzero-bot
    Contributor
    • Reproduced: Skipped — not-actionable
    • Exploration: Partial
    • Unit Test: No — skipped as not-actionable
    • Priority: P2: Has Workaround. The requested standalone type-check workflow is not available, but users can achieve something similar with vp check --no-lint (when lint.options.typeCheck is enabled) or by running vp exec tsgo, so the current impact is mitigated.

    This issue is a feature request for a dedicated type-check command surface rather than a reproducible bug. Current main already has partial support for the underlying workflow: vp check --no-lint skips lint rules while still running type checks (gated by lint.options.typeCheck), and vp lint --type-check enables type checking inside the lint command. The remaining gap is whether Vite+ exposes this as a first-class vp typecheck command or via independently toggleable flags on vp check.

    I wasn't able to find a fix for this issue, but I identified some areas that may be relevant. The relevant command routing appears to live in the TypeScript/Rust CLI layer for vp check and vp lint, and the final design depends on whether Oxlint's --type-check-only flag should be surfaced directly as vp typecheck or folded into vp check --no-lint / --no-type-check semantics. A human maintainer should decide between those product directions.

    Full Triage Report

    Triage Report: Issue #1275

    Issue Summary

    Title: Add vp typecheck command

    Reporter: @mizdra

    Type: Feature request / enhancement

    The reporter requests a dedicated vp typecheck command (or equivalent mechanism) that runs only TypeScript type checking without formatting or linting. The motivation is a workflow where fixing type errors first can also resolve downstream lint errors, so being able to run type checks in isolation is more efficient after large refactors such as enabling noUncheckedIndexedAccess or bulk find-and-replace.

    The discussion evolved through several alternatives:

    • A standalone vp typecheck command.
    • A --type-check-only flag on vp lint or vp check.
    • Reusing existing --no-fmt / --no-lint flags and treating type checking as a first-class concern in vp check.

    A maintainer (@fengmk2) ultimately proposed redefining vp check --no-lint to skip lint rules while still running type checks (when type checking is enabled), and adding --no-type-check to disable type checks. Later comments suggested reconsidering a standalone vp typecheck command based on oxlint --type-check-only.

    Current Checkout Behavior

    • vp check already supports --no-fmt and --no-lint, with help text stating that --no-lint skips lint rules but type-check still runs when lint.options.typeCheck is true.
    • vp lint already supports a --type-check flag to enable experimental type checking.
    • There is no standalone vp typecheck command.

    Reproduction Attempt

    This is a feature request rather than a bug report. No incorrect runtime behavior was reported to reproduce. The current vp check --no-lint behavior partially addresses the original motivation (running type checks without lint), but it is gated by lint.options.typeCheck rather than being an independently toggleable concern, and a dedicated vp typecheck command does not exist.

    Result

    Skipped: not-actionable

    The issue is a feature request / discussion about command design, not a Vite+ bug report. Per the triage instructions, feature requests are skipped as not-actionable for automated bug reproduction.

    Environment

    • vp v1.4.0
    • Node.js v22.23.4
    • pnpm v12.11.2
    • OS: Linux x64 (runner)

    This report was made by an LLM. The analysis may be wrong, and the potential fix might not work, but is intended as a starting point for exploring the issue.

  17. fengmk2 commented on Oct 30, 2026

    @fengmk2
    Member

    A separate typecheck subcommand will not be added for now. You can currently configure it via scripts.typecheck and run the custom command with vpr typecheck.

  18. cholwell commented on Dec 2, 2026

    @cholwell

    It feels slightly at odds with Vite+’s goal of being a unified toolchain that type-checking requires lint configuration or a custom script, rather than having a dedicated command. Is that something that might be reconsidered?

  19. cpojer commented on Dec 2, 2026

    @cpojer
    Member

    You got it wrong. Type checking and linting are exactly the same thing. vp check is all you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Fields

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions