Personal Opinionated React Starter Template
-
Typescript
-
I18n ready via react-i18next
-
ESLint, Prettier and stylelint. Pre-check with Husky and lint-staged.
-
CI/CD via GitHub Actions
-
Ant design integration
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
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.
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 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