Skip to content

alexey-koran/react-template

Repository files navigation

React template

Contributor Covenant

Minimum node version Minimum npm version

Recommended node version Recommended pnpm

AS A PACKAGE MANAGER, I HIGHLY RECOMMEND USING PNPM

AS A NODE.JS VERSION MANAGER, I HIGHLY RECOMMEND USING NVM

Installation

git clone repo_url
cd project_location
pnpm i

Scripts

Start developer mode (support hot reload)

pnpm dev

Start production mode (with some build optimizations)

pnpm prod

Dev & prod scripts use the 8080 port

http://localhost:8080/

Clean build folder

pnpm clean

Build application for deploy

pnpm buildapp

Clean build folder & rebuild application for deploy

pnpm build

Start webpack plugin for bundle analyze

pnpm analyze

Husky utility script, starts only once, at the packages installation (not need to be manually called anytime)

pnpm prepare

Start formatter check on all files

pnpm prettier

Start formatter autofix on all files

pnpm prettier:fix

Start eslint check on all files

pnpm lint

Start eslint autofix on all files

pnpm lint:fix

Start eslint autofix only on git staged files

pnpm lint:fix-staged

Start stylelint check on all files

pnpm lint:css

Start stylelint autofix on all files

pnpm lint:css:fix

Start stylelint autofix only on git staged files

pnpm lint:css:fix-staged

Start prettier, eslint & stylelint check processes in order

pnpm lint-all

Start prettier, eslint & stylelint autofix processes in order

pnpm fix-all

Start lint-staged fix scripts from .lintstagedrc on git staged files (husky automatically call it on git pre-commit hook)

pnpm fix-staged

Start svgo on passed svg file (size optimization)

pnpm svgo $FILE_PATH

Start svgo on all svg files in the project (size optimization)

pnpm svgo-all

Known issues:

Temporary disabled postcss stylelint due to that it and stylelint-prettier don't support ESM