/vite-react-template

A ready-to-use React project template with Vite for fast development, Vitest for testing, MSW for API mocking, and ESLint & Prettier for code quality.

Primary LanguageJavaScript

React Template with Vite, Vitest, MSW, ESLint, and Prettier

This repository serves as a template for a React project using Vite, Vitest, MSW, ESLint, and Prettier.

Features

  • Vite: A next-generation frontend tooling. It's fast and lean, delivering an unmatched developer experience.
  • React: A JavaScript library for building user interfaces.
  • Vitest: A unit testing framework designed for Vite. It provides a simple and fast testing experience.
  • MSW: Mock Service Worker (MSW) is an API mocking library that uses Service Workers to intercept actual requests. Ideal for front-end development and testing.
  • ESLint: A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript.
  • Prettier: An opinionated code formatter that ensures that all outputted code conforms to a consistent style.

Getting Started

  1. Clone this repository
  2. Install dependencies with pnpm install
  3. Start the development server with pnpm run dev

Testing

Run pnpm run test to execute the unit tests via Vitest.

Mocking

MSW is set up and ready to use in the src/mocks directory. Add your handlers there.

Linting and Formatting

ESLint and Prettier are configured for this project. Run npm run lint to check the code for any linting errors.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT