eslint-config-last
is an opinionated ESLint config which incorporates Prettier for even better code formatting and unification.
Yarn version:
- Add
eslint-config-last
to your project:yarn add eslint-config-last -D -E
. - Add peer dependencies:
yarn add eslint babel-eslint prettier eslint-config-prettier eslint-plugin-prettier -D -E
. - Create
.eslintrc.js
configuration file:
module.exports = {
extends: ['last'],
};
- Add lint scripts to
package.json
:
"scripts": {
"lint": "yarn eslint .",
"lint:fix": "yarn lint --fix"
}
- Run
yarn lint
to lint your code. - Run
yarn lint:fix
to lint, format and fix your code.