Personal Opinionated React Starter Template
-
Typescript
-
I18n ready via react-i18next
-
ESLint, Stylelint. Pre-check with Husky and lint-staged.
-
CI/CD via GitHub Actions
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 iYou can run the project by following scripts:
pnpm devWe use React ^19 and Vite ^7. 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.
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.
This project uses GitHub Actions to do CI, you can check details in .github/workflows. To skip CI/CD, you can check
this page.
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.
You have to allow the rules below to ensure code quality
-
Only push codes when all tests pass
-
Commit message should follow Conventional Commits. Try commit-ez
We follow antfu eslint-config to minimize eslint config
Some other code styles listed below (recommended)
-
Follow Clean Code Javascript
-
Use the
ComponentNamePropsto name the Props and export -
Use FC to type define a component