@substantial/eslint-config
v1.1.1
Published
Substantial's minimal eslint config
Downloads
44
Keywords
Readme
@substantial/eslint-config
A base, hopefully non-controversial eslint config for our projects.
Installation
$ yarn add --dev @substantial/eslint-config eslint-config-prettier eslint-plugin-prettier
For jest also run:
$ yarn add --dev eslint-plugin-jest
For react also run:
$ yarn add --dev eslint-config-react-app @typescript-eslint/eslint-plugin @typescript-eslint/parser babel-eslint eslint-plugin-flowtype eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
Usage
Add this to your eslint config, leaving out any configs that do not apply to your project:
{
"extends": [
"@substantial/eslint-config",
"@substantial/eslint-config/react",
],
"overrides": [
{
"files": ["**/*.test.[jt]s?(x)"],
"extends": [
"@substantial/eslint-config/jest"
]
}
]
}
Details
@substantial/eslint-config
Uses eslint:recommended
as well as some of the TypeScript overrides from eslint-config-react-app
@substantial/eslint-config/react
@substantial/eslint-config/jest
The usage guide assumes tests are in files ending in .test.js
(or jsx
, ts
,
tsx
), but you may change the files override to anything you like.