3.1.0 • Published 8 months ago
eslint-config-ebates v3.1.0
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/reactebates/typescript
Installation
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
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" optionalDependenciesReact
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'],
// ...
};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 typescriptThen update .eslintrc.js:
module.exports = {
extends: ['ebates', 'ebates/typescript'],
// ...
};