This the base ESLint configuration I use in personal TypeScript projects, as an installable npm
package:
✔ Extends the popular Airbnb Style Guide
✔ Uses Prettier for code formatting
✔ Provides additional linting for Jest, React
- Install the package and its minimum required peer dependencies:
npm install -D kael89/eslint-config-kael89-ts#v2.3.1 eslint prettier
- Extend this package in your ESLint configuration:
{
"extends": "kael89-ts"
}
tsconfig.json
under the project's root), you need to specify its path:
{
"parserOptions": {
"project": "ts/tsconfig.dev.json"
}
}
Configuration for rule "@typescript-eslint/indent" is invalid
it is a known eslint-config-airbnb-typescript issue, see that link for possible solutions.
👉 For the best linting experience, we suggest including the settings specified in tsconfig.json
in your project's TS configuration.
Author: Kostas Karvounis https://codinglicks.com