Skip to content

stackbit/eslint-config

Repository files navigation

eslint-config NPM version

Stackbit's shareable config for ESLint

Installation

Install ESLint and @stackbit/eslint-config:

npm install --save-dev eslint @stackbit/eslint-config

Prettier

@stackbit/eslint-config should be used in conjunction with Prettier. See the @stackbit/prettier-config installation guide for more details.

Usage

Stackbit's ESLint rules come bundled in @stackbit/eslint-config. To enable these rules, add an eslintConfig property in your package.json. See the ESLint configuration docs for more details.

"eslintConfig": {
  "extends": ["@stackbit"]
}

Now you can run ESLint by adding the following scripts to your package.json. See the ESLint CLI docs for more details.

"scripts": {
  "lint:js": "eslint --cache --ext .js,.jsx .",
  "format:js": "npm run lint:js -- --fix"
}

Lint it:

npm run lint:js

Format it:

npm run format:js