@justia/eslint-config-react
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

@justia/eslint-config-react version 2.1.6

Justia's ESLint configuration for React projects

This package uses @justia/eslint-config as a base configuration, slightly modifies prettier rules and adds React-specific rules for React projects.

Install

Install the correct versions of the peer dependencies, which are listed by the command:

npm info "@justia/eslint-config-react@latest" peerDependencies

If using npm 5+, use this shortcut

npx install-peerdeps --dev @justia/eslint-config-react

If using npm < 5, Linux/OSX users can run

(
export PKG=@justia/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 @justia/eslint-config-react eslint@^#.#.# prettier@^#.#.# babel-eslint@^#.#.# eslint-config-prettier@^#.#.# eslint-plugin-import@^#.#.# eslint-plugin-prettier@^#.#.# eslint-plugin-promise@^#.#.# eslint-plugin-jsx-a11y@^#.#.# eslint-plugin-react@^#.#.# eslint-plugin-react-hooks@^#.#.#

Usage

@justia/eslint-config-react

Default configuration that contains all the base ESLint rules, including ECMAScript 6+ and React. It requires the following external packages:

  • eslint
  • prettier
  • babel-eslint
  • eslint-config-prettier
  • eslint-plugin-import
  • eslint-plugin-prettier
  • eslint-plugin-promise
  • eslint-plugin-jsx-a11y
  • eslint-plugin-react

After installation of the package and the peer dependencies, add "extends": ["@justia/eslint-config-react"] to your .eslintrc.

@justia/eslint-config-react/hooks

This entry point enables the linting rules for React hooks (requires v16.8+). It requires eslint-plugin-react-hooks.

To use, add the following to your .eslintrc:

{
  "extends": [
    "@justia/eslint-config-react",
    "@justia/eslint-config-react/hooks"
  ]
}

Package Sidebar

Install

npm i @justia/eslint-config-react

Weekly Downloads

6

Version

3.0.0

License

MIT

Unpacked Size

38 kB

Total Files

11

Last publish

Collaborators

  • justiauser
  • mayrop
  • digznav