Skip to content

wwwenjie/react-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-starter

Personal Opinionated React Starter Template

Features

Running the project

This project use pnpm as package manager, install it if you haven't installed.

You need to install dependencies before running project at first time

pnpm i

You can run the project by following scripts:

pnpm dev

Develop

We use React ^18 and Vite ^3. If you are looking for any 3rd party lib, Please check if the version supports.

Redux or other state library are not recommended unless you are going to build a complex project. For simple or middle project, consider using SWR and localstorage.

Running the tests

We use vitest to run tests. You can run pnpm watch:test to start a watching test or run pnpm test:unit to run full unit tests. When you add/edit common components, it is recommended to write tests for them.

CI/CD

This project uses GitHub Actions to do CI, you can check details in .github/workflows. To skip CI/CD, you can check this page.

Release

This project use standard-version to manage release, run pnpm release will create new version with tag. When tags with version pushed, a GitHub release will create.

Rules

You have to allow the rules below to ensure code quality

Code Style

We follow airbnb code style, but we have customized some code style in prettier, you can check prettier for details

Some other code styles listed below (recommended)

  • Follow Clean Code Javascript

  • Use the ComponentNameProps to name the Props and export

  • Use FC to type define a component