@infuse/eslint-config

2.0.4 • Public • Published

Infuse Eslint Config

Installation

yarn add -D eslint @infuse/eslint-config

Usage

When working on a React project, for example, create .eslintrc.json at the root of your project with the contents:

{ "extends": ["@infuse/eslint-config/react"] }

In your test subdirectory, create another .eslintrc.json with the contents:

{ "extends": ["@infuse/eslint-config/jest"] }

The available configs are:

  • node
  • react
  • react-native
  • jest
  • mocha
  • typescript

Peer Dependencies

Dependencies of ESLint configs are listed in package.json under peerDependencies. For some background, see:

The peer dependencies listed in this project's package.json are the minimum required to make all of the configs work. You will only ever need a subset of them, depending on the config you are using.

This project's devDependencies are those required to run the base config, because that config is used to lint the project itself. Because they are required by the base config, it might be helpful to begin by installing those peerDependencies that are also listed as devDependencies, then continue installing peerDependencies as required by any ESLint errors.

Contribution

If you find yourself making an exception to these rules consistently or think that any others should be standardized, please open an issue or submit a PR. Please maintain separation of environments and proper inheritance.

All configs must be kept at the project root for nice imports (@infuse/eslint-config/node, etc).

To generate json specifying all rules being applied to a particular file, run:

npx eslint --print-config <file>

Readme

Keywords

Package Sidebar

Install

npm i @infuse/eslint-config

Weekly Downloads

5

Version

2.0.4

License

MIT

Unpacked Size

6.51 kB

Total Files

10

Last publish

Collaborators

  • infuse