Home

Awesome

eslint and jest

Just one of the things I'm learning. https://github.com/hchiam/learning

Once:

npm install

Then:

npm run lint # this runs: eslint *.js
npm run test

or for continuous watch and live re-run of linting and unit tests:

nodemon -w index.js -x 'npm run fix; npm run lint; npm run test; node index.js;'

You can manually auto-fix as many linter errors as possible with eslint --fix index.js, or just:

npm run fix

yarn version of the commands

yarn (or yarn install) and then:

yarn lint
yarn fix
yarn test
nodemon -w index.js -x 'yarn fix; yarn lint; yarn test; node index.js;'

Or just:

yarn auto-test

Reminder of installations

touch package.json
npm install --save-dev eslint eslint-config-google
./node_modules/.bin/eslint --init
npm install --save-dev jest-cli
npm install -g nodemon