This is an opinionated template, for setting up a React app.
It uses:
- Vite
- TypeScript
- ESLint
- Prettier
- React Router
- Scoped SCSS
- Create Vite with the
react-ts
template- Getting Started | Vite
- Run on of the following:
yarn create vite <project-name> --template react-ts
npm init vite@latest <project-name> --template react-ts
- Install the packages
cd <project-name>
- Run one of the following:
yarn install
or justyarn
npm install
- Install ESLint
- Getting Started with ESLint - ESLint - Pluggable JavaScript linter
- CAUTION: This step, might install a version of
ESLint
that does not meet the requirements of other packages in thedevDependencies
. It probably won't cause any issues, but it will produce a warning. - Run one of the following:
yarn add eslint --dev
npm install eslint --save-dev
- Initialize ESLint
- Run one of the following:
eslint --init
yarn run eslint --init
npx eslint --init
- NOTE: At the end of this step you will be asked to install some packages through
npm
. If you accept it, you will need to runyarn install
, afterwards. If you do not accept it, manually install the packages mentioned.
- Run one of the following:
- Install Prettier & plugins
yarn add prettier eslint-plugin-prettier eslint-config-prettier eslint-config-airbnb-typescript --dev
npm install prettier eslint-plugin-prettier eslint-config-prettier eslint-config-airbnb-typescript --save-dev
yarn dev
or npm run dev
yarn build
or npm run build
yarn serve
or npm run serve
NOTE: You have to build it first.