@kiwicom/eslint-config
v12.7.3
Published
Kiwi.com's ESlint config for TypeScript and Flow.
Downloads
3,568
Keywords
Readme
@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