This package contains shared rules for ESlint with TypeScript and Prettier.
Inspired by https://dev.to/robertcoopercode/using-eslint-and-prettier-in-a-typescript-project-53jb
eslint-config v4 refactor rules and divide config for node and react
eslint-config v3 supports ESlint 8.
eslint-config v2 requires ESlint 7.
Use eslint-config v1 for ESlint 6 + TSlint.
Install ESlint:
yarn add eslint prettier @emanprague/eslint-config -D
Update config files as follows:
(use correct config, eslint-node for backend and eslint-react for frontend)
module.exports = {
extends: [
"@emanprague/eslint-config/eslint-[node|react]"
],
settings: {
react: {
version: "detect",
},
},
env: {
browser: true,
},
}
And you should be good to go with:
eslint \"./src/**/*.{ts,tsx}\" --cache
How to release:
- manually set version in package.json
- push
- create a new release in GH