1.0.1 • Published 3 years ago
eslint-config-trondal v1.0.1
- Package for common eslint rules.
Installation
- npm install trondal-eslint-config --save-dev
- Add "eslint-config-trondal" to eslint-> extend section. (see below for example)
"eslintConfig": {
"extends": [
"eslint-config-trondal"
],
"rules": {}
}
Explanation
Rule | Description |
---|---|
eslint-config-airbnb | Standard main config |
eslint-plugin-import, eslint-plugin-jsx-a11y, eslint-plugin-react, eslint-plugin-react-hooks | Dependencies of eslint-config-airbnb |
eslint-config-prettier | Remove rules that conflicts with prettier |
eslint-plugin-jest | Jest(testing) rules |
Usage
npm install 'eslint-config-toll'
Overrride in your project
In package.json, .eslintrc.json or whatever file you use for eslint configuration, add the rules to the "rules" section. For instance if I want to allow non-closing components (<div></div>
), I add this to package.json:
"eslintConfig": {
"extends": [
"eslint-config-trondal"
],
"rules": {
"react/self-closing-comp": 0
}
},
Override global rules.
If you want to change the rules "globally", it should be done in this repo, and can be set in the "rules" section of index.js.