eslint-config-typescript
ESLint shareable config for the Baloise style.
Installation
yarn add -D eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript
Create a .eslintrc
file with the following content.
{
"extends": [
"@baloise/eslint-config-typescript"
]
}
Use prettier formatter
yarn add -D prettier eslint-config-prettier
Add prettier
and prettier/@typescript-eslint
to your .eslintrc
file.
{
"extends": [
"@baloise/eslint-config-typescript",
"prettier",
"prettier/@typescript-eslint"
]
}
Create a .prettierrc
file with the following content.
{
"singleQuote": true,
"semi": false,
"trailingComma": "all"
}
Open your package.json
and add the following script command format
.
"scripts": {
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
...
},