Vite + React + TypeScript Template
A minimal, production-ready template for building React applications with Vite, TypeScript, and modern tooling.
Features
- โก๏ธ Vite - Fast build tool with HMR
- โ๏ธ React 19 - Latest React with TypeScript
- ๐ง SWC - Fast TypeScript/JSX compilation
- ๐งช Vitest + Testing Library - Unit testing with React Testing Library
- ๐จ Prettier - Code formatting
- ๐ OxLint + ESLint - Fast, comprehensive linting
- OxLint handles performance-critical rules
- ESLint handles React-specific and stylistic rules
- ๐ฆ pnpm - Fast, disk-efficient package manager
Getting Started
# Install dependencies pnpm install # Start development server pnpm dev # Build for production pnpm build # Preview production build pnpm preview
Available Scripts
pnpm dev- Start development serverpnpm build- Build for production (includes type checking)pnpm preview- Preview production buildpnpm test- Run tests oncepnpm test:watch- Run tests in watch modepnpm test:ui- Run tests with UIpnpm test:coverage- Run tests with coverage reportpnpm typecheck- Run TypeScript type checkingpnpm lint- Run OxLint and ESLintpnpm lint:fix- Auto-fix linting issuespnpm format- Format code with Prettierpnpm format:check- Check code formatting
Project Structure
โโโ src/
โ โโโ test/
โ โ โโโ setup.ts # Test setup (jest-dom matchers)
โ โโโ App.tsx # Main app component
โ โโโ App.test.tsx # App component tests
โ โโโ main.tsx # App entry point
โโโ index.html # HTML template
โโโ vite.config.ts # Vite configuration
โโโ vitest.config.ts # Vitest configuration
โโโ tsconfig.json # TypeScript config (references)
โโโ tsconfig.app.json # TypeScript config for app code
โโโ tsconfig.node.json # TypeScript config for Node.js tooling
โโโ eslint.config.js # ESLint configuration
โโโ oxlintrc.json # OxLint configuration
โโโ .prettierignore # Prettier ignore patterns
Linting Strategy
This template uses a dual-linting approach with strict type checking enabled by default:
-
OxLint runs first with type-aware checking and handles:
- Correctness rules (syntax errors, common mistakes)
- React rules (jsx-key, no-children-prop, etc.)
- TypeScript rules (await-thenable, no-floating-promises, etc.)
- Unicorn rules (modern JavaScript patterns)
- Accessibility rules (jsx-a11y)
-
ESLint runs second with:
- OxLint-handled rules disabled (via
eslint-plugin-oxlint) - Strict type-aware TypeScript rules (
strictTypeChecked) - Stylistic type-aware rules (
stylisticTypeChecked) - React-specific rules (hooks, refresh)
- OxLint-handled rules disabled (via
This configuration provides comprehensive safety and consistency out of the box.