2.0.1 • Published 4 years ago

eslint-config-wannabook v2.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Wannabook eslint config

About

This package includes basic ESLint config and prettier inside of it. Rules apply to ES6 and React.

Installation

Install eslint together with our custom package as an npm dependency:

npm i eslint-config-wannabook --save-dev

Then add the following peer dependencies to devDependencies in package.json:

    "babel-eslint": "10.0.1",
    "eslint-config-airbnb": "17.1.0",
    "eslint-config-prettier": "4.1.0",
    "eslint-plugin-babel": "5.3.0",
    "eslint-plugin-import": "2.14.0",
    "eslint-plugin-jsx-a11y": "6.1.1",
    "eslint-plugin-prettier": "3.0.1",
    "eslint-plugin-react": "7.11.0",
    "prettier": "1.16.4"

In your project, create a .eslintrc file and write:

{
  "extends": "wannabook"
}

Make sure ESLint is turned on in your IDE.

You can override wannabook's rules and add yours below, like this:

{
  "extends": "eslint-config-wannabook",
  "rules": {
      "camelcase": "warn",
      "comma-dangle": [2, "only-multiline"],
  }
}

Prettier auto-fix on commit

Install respective packages:

npm i husky lint-staged --save-dev

and add the following lines to your package.json:

"husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
},
"lint-staged": {
    "*.{js,json,css,md}": [
      "prettier --write",
      "git add"
    ]
}
2.0.1

4 years ago

2.0.0

4 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago