2.3.1 • Published 4 years ago

eslint-config-ebates v2.3.1

Weekly downloads
116
License
MIT
Repository
github
Last release
4 years ago

Build Status

eslint-config-ebates

This package provides ESLint shareable configs which allow us to maintain a consistent coding style across our Javascript repositories.

Our base configuration, ebates, extends eslint-config-airbnb-base, both base and strict set of rules. We also provide configuration for other environments:

  • ebates/flowtype
  • ebates/react
  • ebates/typescript

Installation

To install both the dependencies and peer-dependencies, make sure you have npm 5+ and run

npx install-peerdeps --dev eslint-config-ebates

Note: install-peerdeps will automatically detect if you're using yarn or npm.

In .eslintrc.js, simply add:

module.exports = {
  extends: 'ebates',
  // ...
};

Other configurations

Other configurations require dependencies listed as optional. First, install the main package as noted in the previous section. Then run the following command to check the supported version to install.

npm info "eslint-config-ebates@latest" optionalDependencies

Flowtype

Run

yarn add -D eslint-plugin-flowtype@<version>

Then update .eslintrc.js:

module.exports = {
  extends: [
    'ebates',
    'ebates/flowtype',
  ],
  // ...
};

React

Run

# Install eslint-config-airbnb peer dependencies. Skip `eslint` as we've already installed it as
# a peer dependency for our config earlier (in the Installation step).
yarn add -D eslint-config-airbnb eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks

Then update .eslintrc.js:

module.exports = {
  extends: [
    'ebates',
    'ebates/react',
  ],
  // ...
};

TypeScript

Run

# Install @typescript-eslint peer dependencies. Skip `eslint` as we've already installed it as
# a peer dependency for our config earlier (in the Installation step).
yarn add -D @typescript-eslint/parser @typescript-eslint/eslint-plugin typescript

Then update .eslintrc.js:

module.exports = {
  extends: [
    'ebates',
    'ebates/typescript',
  ],
  // ...
};