1.0.1 • Published 3 years ago

eslint-config-trondal v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago
  • Package for common eslint rules.

Installation

  1. npm install trondal-eslint-config --save-dev
  2. Add "eslint-config-trondal" to eslint-> extend section. (see below for example)
"eslintConfig": {
    "extends": [
        "eslint-config-trondal"
    ],
    "rules": {}
}

Explanation

RuleDescription
eslint-config-airbnbStandard main config
eslint-plugin-import, eslint-plugin-jsx-a11y, eslint-plugin-react, eslint-plugin-react-hooksDependencies of eslint-config-airbnb
eslint-config-prettierRemove rules that conflicts with prettier
eslint-plugin-jestJest(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.