eslint-config-keep
ESLint shareable config for Keep, based off the Google JavaScript style guide (ES2015+ version).
Installation
npm i https://github.com/keep-network/eslint-config-keep.git
Usage
Setting up a project
- Install the linter and config -
npm i -D eslint https://github.com/keep-network/eslint-config-keep.git
- Create your
.eslintrc
:
{
"extends": "eslint-config-keep",
"rules": {
// Additional, per-project rules...
},
}
- Add commands for linting to your
package.json
:
{
"scripts": {
"lint:js": "eslint .",
"lint:js:fix": "eslint --fix ."
},
}
pre-commit
Adding a pre-commit hook using - repo: local
hooks:
- id: lint-js
name: 'lint js'
entry: /usr/bin/env bash -c "npm run js:lint"
files: '\.js$'
language: script
description: "Checks JS code according to the package's linter configuration"