Welcome to @ts-dev-tools/react ⚛️
Typescript dev tools for a ReactJS project
What’s included
Inherit from @ts-dev-tools/core
👕 Code quality
- Reuse the Biome linting and formatting workflow from @ts-dev-tools/core
🧪 Tests
- Configure Vitest with the
jsdomenvironment for React projects - Install react tests libraries:
- @testing-library/jest-dom: Custom DOM matchers for Vitest tests
- @testing-library/react: Simple and complete React DOM testing utilities
- @testing-library/react-hooks: Simple and complete React hooks testing utilities
- react-test-renderer: React renderer required by
@testing-library/react-hooks
📖 Types
Usage
Vitest 5 requires Node.js >= 22.12.0.
1. Install
npm install --save-dev @ts-dev-tools/react
Or
pnpm add --save-dev @ts-dev-tools/react
Or
yarn add --dev @ts-dev-tools/react
Vitest 5 stores generated artifacts under .vitest/. Add that directory to your .gitignore if it is not already ignored.
2. Enable ts-dev-tools
npm exec ts-dev-tools install
Or
pnpm ts-dev-tools install
Or
yarn ts-dev-tools install
⚠️ If your package is using yarn, is not private and you’re publishing it on a registry like npmjs.com, you need to disable postinstall script using pinst. Otherwise, postinstall will run when someone installs your package and result in an error.