npm i -D @yandeu/eslint-config
// .eslintrc
{
"extends": "@yandeu/eslint-config"
}
// package.json
"scripts": {
"lint": "eslint src --ext .ts,.tsx",
"lint:fix": "eslint --fix src --ext .ts,.tsx"
}
// .eslintrc
{
"extends": "@yandeu/eslint-config",
"rules": {
"my-eslint-rule": "error"
}
}
Using TypeScript? Maybe you also want to add the rules below:
{
// no-dupe-class-members ts fix
"no-dupe-class-members": "off",
"@typescript-eslint/no-dupe-class-members": ["error"],
// no-redeclare ts fix
"no-redeclare": "off",
"@typescript-eslint/no-redeclare": ["error"]
}
- name: Run ESLint
run: npm run lint
Install @yandeu/prettier-config.
Using VSCode? Install the ESLint Extension.