6.0.0 • Published 5 years ago
@lendesk/eslint-config-lendesk v6.0.0
eslint-config-lendesk
Lendesk JS ESLint Standard Config. This is based on StandardJS with some minor adjustments to work with Prettier
Installation
Install the config:
$ yarn add -D @lendesk/eslint-config-lendesk
Install the peer dependencies shown after running the above command (using yarn -D
)
Then install Prettier for formatting concerns:
$ yarn add -D prettier
Once the linter and prettier are setup it is recommended to add a git commit hook to auto-run these tools when code is committed. To do this:
- Install Husky and LintStaged:
yarn add -D husky lint-staged
- Add lint-staged config to
package.json
:
"lint-staged": {
"*.js": [
"prettier --write",
"eslint --fix",
"git add"
]
}
- Add
precommit
script to thepackage.json
"scripts" section:
"scripts": {
"precommit": "lint-staged"
}
Usage
In ESLint config (e.g. .eslintrc.json
)
{
"extends": "@lendesk/eslint-config-lendesk"
}