@kiwicom/eslint-config

12.7.3 • Public • Published

@kiwicom/eslint-config

Our ESlint config.

Add the following script to your package.json:

{
  "scripts": {
    "lint": "eslint . --max-warnings 0"
  }
}

Increase the number of warnings to your current number of warnings to avoid introducing new ones.

Available configs to extend:

  • @kiwicom/eslint-config - core, Babel, Node, imports
  • @kiwicom/eslint-config/ts - TypeScript
  • @kiwicom/eslint-config/flow - Flow
  • @kiwicom/eslint-config/react - React
  • @kiwicom/eslint-config/jest - Jest

Setup

Your .eslintrc.js:

// Example config for a React+Jest project with both TS and Flow
module.exports = {
  extends: ["@kiwicom", "@kiwicom/eslint-config/react", "@kiwicom/eslint-config/jest"],
  overrides: [
    {
      // TypeScript
      files: ["*.ts", "*.tsx"],
      extends: ["@kiwicom/eslint-config/ts"],
      parserOptions: {
        project: "./tsconfig.json",
      },
    },
    {
      // Flow
      files: ["*.js", "*.jsx", "*.js.flow"],
      extends: ["@kiwicom/eslint-config/flow"],
    },
  ],
};

Prettier

Prettier rules to avoid conflicts are included, however, prettier itself is not.

Install yarn add prettier -D separately, create prettier.config.js and add the following scripts to your package.json:

{
  "scripts": {
    "prettier": "prettier --check .",
    "fmt": "prettier --write ."
  }
}

Development

Benchmark:

  • TIMING=1 eslint ...

Checking prettier conflicts:

  • npx eslint-config-prettier index.js

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @kiwicom/eslint-config

Weekly Downloads

619

Version

12.7.3

License

MIT

Unpacked Size

52 kB

Total Files

8

Last publish

Collaborators

  • mvidalgarcia
  • dsil
  • jakubzaba
  • robincsl_kiwi
  • kiwicom.platform
  • dinodsaurus