First install eslint
and the config as devDependencies
, using either yarn
or npm
:
yarn add -D eslint eslint-config-7geese
npm install -D eslint eslint-config-7geese
Next, you'll need to install any plugins you wish to use. In most cases, you'll want them all, so you can install them all with (this example using yarn
):
yarn add -D \
eslint-plugin-7g \
eslint-plugin-compat \
eslint-plugin-filenames \
eslint-plugin-import \
eslint-plugin-jest \
eslint-plugin-jsx-a11y \
eslint-plugin-promise \
eslint-plugin-react \
eslint-plugin-react-hooks
Add this config under the "extends"
part of your .eslintrc
file:
{
"extends": "7geese"
}
If there are plugins or rules which you do not want to use, you'll have to opt-in/out of the specific rulesets which you want to use: By extending the specific subpackage you want
{
"extends": [
"7geese/rules/eslint/best-practices",
"7geese/rules/eslint/errors",
"7geese/rules/react",
]
}
For more details about how shareable configs work, see the ESLint documentation.
Inspired heavily by AirBnB, Walmart and Formidable ESLint configs.
Check out our ESLint plugin, with some rules for writing JavaScript code at 7Geese.