basic-js-code-quality-tools

Testing with Jest

see Jest documentation

npm install --save-dev jest

Run tests with npm test.

Formating with prettier

see Prettier documentation

npm install --save-dev --save-exact prettier
echo {}> .prettierrc.json

check configuration

Use commands npm run prettier:check or npm run prettier:write.

Linting with ESLint

see ESLint documentation

npm init @eslint/config

check rules

You can use eslint:recommended rules preset or can try Airbnb JavaScript Style Guide To get it npm install --save-dev eslint-config-airbnb-base and put it in your .eslintrc file extends section.

Use commands npm run lint or npm run lint:fix.