vitest-dev / vitest-dev/vitest

Enable --typecheck by default?

Open
#7,773 1 comment 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement: pending triage
Dominant language
TypeScript
Stars
17.1k
Forks
2k
Avg merge
1d 22h
Merged PRs (30d)
94

Description

Clear and concise description of the problem

Right now, if you want to use the awesome new Testing Types, you have to provide a manual --typecheck:

npx vitest --typecheck

I think we can assume many types testing users go with the default behavior of putting all types tests in .test-d.ts files:

 ✓ src/a.test.ts (9 tests) 5ms
 ✓ src/b.test.ts (10 tests) 6ms
 ✓  TS  src/c.test-d.ts (0 test)
Suggested solution

How about enabling --typecheck by default?

Alternative

Or, failing that, some subset of --typecheck that does not impact non-*.test-d.ts files? I'll admit I'm not deeply familiar with the mode to know if there's some conflict.

Additional context

No response

Validations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the Testing Types guide and running the documented npx vitest --typecheck example. Trace where the --typecheck CLI option is configured and check how .test-d.ts files are handled. Done means type checking is enabled by default without changing behavior for regular test files, or the supported subset is clearly defined and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.