@bedandbreakfast/eslint-config
v1.0.14
Published
ES-Lint Config
Downloads
16
Readme
eslint-config
The ESLint configuration for Bedandbreakfast.eu.
Usage
Setup your project to use
@bedandbreakfast/prettier-config
by following this README.Make sure
@bedandbreakfast/eslint-config
is available in your project.Add an
.eslintrc.js
file at the root of your project that extends this config:module.exports = { extends: '@bedandbreakfast/eslint-config' };
Install the required dependencies into your project using:
( export PKG=@bedandbreakfast/eslint-config; npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev )
This copies the peerDependencies of this project as devDependencies into yours.
On Windows this should work using Git for Windows.
To run ESLint as a pre-commit hook and automatically fix issues add husky and lint-staged using:
npm install husky lint-staged --save-dev
Then copy the following to your
package.json
:"husky": { "hooks": { "pre-commit": "lint-staged" } }, "lint-staged": { "*.{js,jsx,ts,tsx}": [ "eslint --fix", "git add" ] }
That's it, happy coding!