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/react
ebates/typescript
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 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
- Requirements:
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'],
// ...
};
- Requirements:
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'],
// ...
};