npx create-react-app .
npm i prop-types
npm install --save-dev prettier eslint
.prettierrc
-и там такие настройки :
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid",
"proseWrap": "always"
}
npx mrm@2 lint-staged
.huskyrc
-и там такие настройки :
{
"hooks": {
"pre-comit": "lint-staged"
}
}
.lintstagedrc
-и там такие настройки :
{
"src/**/*.{json,css,scss,md}": ["prettier --write"],
"src/**/*.{js,jsx,ts,tsx}": ["prettier --write", "eslint --fix"]
}
.eslintcache
В VSCode => setting.json в конце добавялем для комфортной работы, после
установки плагинов для авто сохранения и форматирования файлов.
{
"files.autoSave": "onFocusChange",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
Деплой на Github pages:
Video
"homepage": "https://Vitaliy-Yakovlev.github.io/my-app"
npm install --save gh-pages
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
npm run deploy
netlify.toml
*там настройка:
[build]
publish = "build"
[[redirects]]
from="/*"
to="/index.html"
status = 200
npm install netlify-cli -g
netlify login
```json “predeploy”: “npm run build”,
“predeploy”: “npm run build”,
“deploy”: “netlify deploy -p”
4. При первом деплои, стрелками выбрать : + Create & configure a new site
5. Зайти на страницу -
```npm
netlify open --site