@mangoweb/eslint-config-ts
ESLint configuration using Prettier designed for TS.
Installation
- Install the config:
$ npm install @mangoweb/eslint-config-ts --save-dev
- And its peer dependencies:
$ npm install @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks prettier --save-dev
- If you want to use the manGoweb prettier config, also run
$ npm install @mangoweb/prettier-config --save-dev
Usage
- Create a
.prettierrc.js
file in your project root:module.exports = { ...require("@mangoweb/prettier-config"), // Or something else // Add any project-specific overrides // E.g. semi: false }
- Create a
.eslintrc.js
in your project root:module.exports = { extends: [ '@mangoweb/eslint-config-ts', ] }
- Configure your ide to use these files. It will likely find them automatically though.
Optionally, also add these to your package.json
:
{
"scripts": {
"eslint:lint": "eslint \"src/**/*.{ts,tsx}\" ",
"eslint:fix": "eslint --fix \"src/**/*.{ts,tsx}\" "
}
}
That's it!