@brudi/eslint-config-react

brudi's ESLint config for React components


Keywords
eslint, config, react
License
Apache-2.0
Install
npm install @brudi/eslint-config-react@2.0.2

Documentation

brudi Toolbox ESLint config

brudi Toolbox `.

Base Eslint shareable config of brudi

NPM NPM NPM NPM

Installation

Install the package with

yarn add -D @brudi/eslint-config

or

npm install --save-dev @brudi/eslint-config

ESLint Setup

Now add the config to either the package.json:

{
  "eslintConfig": {
    "extends": ["@brudi"]
  }
}

or to the .eslintrc or .eslintrc.js:

module.exports = {
  extends: ["@brudi"],
};

React preset

module.exports = {
  extends: ["@brudi/eslint-config-react"],
};

Typescript preset

module.exports = {
  extends: ["@brudi/eslint-config-ts"],
};

Typescript + React preset

module.exports = {
  extends: ["@brudi/eslint-config-tsx"],
};

ESLint and Prettier

  • works together with prettier, thanks to eslint-plugin-prettier
  • the ESLint rules are based on the great work of airbnb's eslint-config-airbnb
  • made for React environment but can be used on a eg. node-server environment as well)
  • handles jest for tests as well
  • env: Browser and Node environment
  • globals: added some related jest variables
  • parser: usage of babel (used babel-eslint parser)

Note: you can still overwrite the env, globals and parser in your local .eslintrc.js.

License

© brudi, 2020. Licensed under an Apache-2 license.

Attribution

Originally forked from NiGhTTraX/eslint-config by Andrei Picus