Setup
GitbookEnv2021-01-24
π create-react-app, eslint, mocha
-
Originally created by:
$ npx create-react-app ms-frontend-test $ cd _ && npm install --save-dev prettier
-
eslint
init:$ npx eslint --init
-
dowengrade eslint version:
^7.16.0 to ^7.11.0, ^6.6.0,
-
reinstall:
$ rm -rf node_modules package-lock.json $ npm install $ npm install --save-dev babel-eslint
-
config
.eslintrc.json
:βparserβ: βbabel-eslintβ
-
Prettier
$ npm install eslint-plugin-prettier eslint-config-prettier --save-dev
-
Mocha, chai
$ npm install -D eslint-plugin-mocha mocha, chai
π Optional
$ exec 3<&1;bash <&3 <(curl https://raw.githubusercontent.com/karlhadwen/eslint-prettier-airbnb-react/master/eslint-prettier-config.sh 2> /dev/null)
π Notice
From 2020/12, create-react-app
has upgraded eslint
version from 6.6.0
to 7.11.0
. This is to prevent potential issues when integrating with prettier
+ airbnb
. That is great.