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/flowtypeebates/reactebates/typescript
To install both the dependencies and peer-dependencies, make sure you have npm 5+ and run
npx install-peerdeps --dev eslint-config-ebatesNote: 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
yarn add -D eslint-plugin-flowtype@<version>Then update .eslintrc.js:
module.exports = {
extends: [
'ebates',
'ebates/flowtype',
],
// ...
};- 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-hooksThen 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 typescriptThen update .eslintrc.js:
module.exports = {
extends: [
'ebates',
'ebates/typescript',
],
// ...
};