vitest
vitest copied to clipboard
docs: global type recommendation
Description
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
- [ ] ~It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.~ Sorry, no prior Issue.
- [x] Ideally, include a test that fails without this PR but passes with it.
- [x] Please, don't make changes to
pnpm-lock.yamlunless you introduce a new test example.
Tests
- [x] Run the tests with
pnpm test:ci.
Documentation
- [x] If you introduce new functionality, document it. You can run documentation with
pnpm run docscommand.
Changesets
- [x] Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with
feat:,fix:,perf:,docs:, orchore:.
Problem
Currently, users are encouraged to use the types property in tsconfig.json, which disables type auto detection.
This can be dangerous as if their project relies on it, it will no longer auto import types and break it. And even if not, it sets a precedent for users to manually manage types from packages that would otherwise be auto imported.
Changes
Recommend importing vitest/globals from a TS file
Deploy Preview for vitest-dev ready!
Built without sensitive environment variables
| Name | Link |
|---|---|
| Latest commit | 67dce54720f729e54452400aec75bbca68c95fe3 |
| Latest deploy log | https://app.netlify.com/sites/vitest-dev/deploys/67077882ce54780008dca6dc |
| Deploy Preview | https://deploy-preview-6676--vitest-dev.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
We are going to align with Vite here: https://github.com/vitejs/vite/pull/20132 (so, keep what we have already)
TypeScript also plans to set types to [] by default, so it seems like TS team is moving into that direction: https://github.com/microsoft/TypeScript/issues/62195