Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

eslint-config-wannabook

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-wannabook

## About

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

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"
    ]
}

Keywords

eslint

FAQs

Package last updated on 18 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts