@beblueapp/eslint-config-react v0.1.0
@beblueapp/eslint-config-react
This package provides Beblue's .eslintrc as an extensible shared config.
Usage
Our default export contains ESLint rules related to React. It requires eslint
, eslint-plugin-import
, eslint-plugin-react
, and eslint-plugin-jsx-a11y
. If you need base rules, see @beblueapp/eslint-config-base.
Install the correct versions of each package, which are listed by the command:
npx install-peerdeps --dev @beblueapp/eslint-config-base
If using yarn, you can also use the shortcut described above if you have npm 5+ installed on your machine, as the command will detect that you are using yarn and will act accordingly. Otherwise, run
npm info "@beblueapp/eslint-config-react@latest" peerDependencies
to list the peer dependencies and versions, then runyarn add --dev <dependency>@<version>
for each listed peer dependency.If using npm < 5, users can run (for Yarn just change
npm install --save-dev
toyarn add -D
)( export PKG='@beblueapp/eslint-config-react'; npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest" )
Which produces and runs a command like:
npm install --save-dev @beblueapp/eslint-config-react 'eslint@^#.#.#' 'eslint-plugin-import@^#.#.#'
Add
"extends": "@beblueapp/eslint-config-react"
to your .eslintrc
@beblueapp/eslint-config-react/hooks
This entry point enables the linting rules for React hooks (requires v16.8+). To use, add "extends": "@beblueapp/eslint-config-react", "@beblueapp/eslint-config-react/hooks" to your .eslintrc