@deuterium/eslint-config
v1.3.3
Published
A package to automatically configure eslint.
Downloads
10
Readme
eslint-config
eslint is useful for linting - spell checking, in a sense - your code.
Installation
Of course, eslint must be installed to use this config.
Main
yarn add --dev eslint @deuterium/eslint-config
Supports
This config supports a variety of eslint configurations.
If using babel
- babel-eslint - Allows for linking of babel code and eslint
yarn add --dev babel-eslint
Extra babel plugins are configured for use with babel-eslint:
- @babel/plugin-transform-runtime - Reduces bundle size
- @babel/plugin-proposal-pipeline-operator - Allows chaining of functions
- @babel/plugin-proposal-do-expressions - Allows more complex versions of ternary operator
- @babel/plugin-proposal-nullish-coalescing-operator - Allows for testing of
null
orundefined
using??
operating - @babel/plugin-proposal-optional-chaining - Allows for optional testing of nested variables.
yarn add --dev @babel/plugin-transform-runtime @babel/plugin-proposal-pipeline-operator @babel/plugin-proposal-do-expressions @babel/plugin-proposal-nullish-coalescing-operator @babel/plugin-proposal-optional-chaining
Airbnb configurations (use only one)
- eslint-config-airbnb - Uses Airbnb's eslint configurations
- eslint-plugin-import, eslint-plugin-react, and eslint-plugin-jsx-a11y are required.
- eslint-config-airbnb-base - Uses Airbnb's eslint configurations without React config
- eslint-plugin-import is required.
Choose one of
yarn add --dev eslint-config-airbnb eslint@^#.#.# eslint-plugin-jsx-a11y@^#.#.# eslint-plugin-import@^#.#.# eslint-plugin-react@^#.#.#
or
yarn add --dev eslint-config-airbnb-base eslint@^#.#.# eslint-plugin-import@^#.#.#
Using Flow
- eslint-plugin-flowtype - Allows for use of Flow types.
- flow-bin and babel-eslint are required.
yarn add --dev eslint-plugin-flowtype flow-bin babel-eslint
Using Prettier
- eslint-plugin-prettier - Plugin to allow for linting using prettier config
- prettier is required.
- eslint-config-prettier - Turns off eslint rules that conflict with prettier rules
yarn add --dev eslint-plugin-prettier prettier eslint-config-prettier
Usage
In package.json
"eslintConfig": {
"extends": [
"@deuterium"
]
}
or in a .eslintrc file:
{
"extends": "@deuterium"
}