without this template | with this template |
---|---|
My custom config template for react-projects without create-react-app or react-scripts
- with React and propTypes -
jsx
branch (git checkout jsx
) - with React and TypeScript -
tsx
branch (git checkout tsx
) - in progress
npm install || npm i
yarn install || yarn
npm start || yarn start
- Run webpack-dev-server with hot-reloading
npm run build || yarn build
npm run serve || yarn serve
npm run deploy || yarn deploy
eslint someFile.jsx
- Check some file
npm run eslint-find
- Check all files inside src/ directory
npm run eslint-fix
- Fix all warnings inside src/ directory
webpack, webpack-cli, webpack-dev-server@4.0.0-beta.3
webpackbar, html-webpack-plugin, compression-webpack-plugin, clean-webpack-plugin
@babel/core, @babel/preset-env, @babel/preset-react, babel-loader
eslint, eslint-config-airbnb, eslint-plugin-import, eslint-plugin-jsx-a11y, eslint-plugin-react, eslint-plugin-react-hooks, eslint-webpack-plugin
npm i -g eslint
npm i --save-dev eslint
npx eslint --init
- To check syntax, find problems, and enforce code style
- JavaScript modules
- React
- TypeScript - No
- Browser
- Popular -> Airbnb -> json;
prettier
with .prettierrc.js
husky, lint-staged
- npm install -D husky
- npm set-script prepare "husky install" && npm run prepare
- npx husky add .husky/pre-commit "npx lint-staged"
- npm i --save-dev husky
- git commit -m "added husky and lint-stagged"
react, react-dom
...
later
autoprefixer, css-loader, css-minimizer-webpack-plugin, cssnano, mini-css-extract-plugin, postcss-loader, sass, sass-loader, style-loader
image-webpack-loader, url-loader
file-loader
express, chalk, compression, browser-sync
gh-pages