eslint-config-cratebind v8.0.1
eslint-config-cratebind
Cratebind ES Lint Config
Installation
- Install ESLint:
$ npm i eslint --save-dev
# OR
$ yarn add eslint
- Install
eslint-config-cratebind
:
$ npm install eslint-config-cratebind --save-dev
# OR
$ yarn add eslint-config-cratebind
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-config-cratebind
globally.
Usage
Create or update the .eslintrc
file in the root of your directory and extend cratebind
. You can omit the eslint-config-
prefix:
{
"extends": ["cratebind"]
}
Then overwrite rules as needed:
{
"extends": ["cratebind"],
"rules": {
// 0 is ignore, 1 is warning, 2 is error
"react/prop-types": 0
}
}
NPM Script
It's recommended to add a lint
script to your NPM scripts:
{
"scripts": {
// --cache flag improves performance, --fix will autofix fixable issues
"lint": "eslint --cache \"**/*.js\" --fix"
}
}
Git Hooks
It's also highly recommended to use Husky and Lint Staged to lint your code before committing:
- Install Husky and Lint Staged
yarn add -D husky lint-staged
- Add these to your
package.json
{
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.+(js|ts|tsx)": [
"eslint --cache --fix --quiet",
"git add"
]
}
}
This combination is
2 years ago
2 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago