@imhoff/eslint-config v3.11.5
@imhoff/eslint-config
My personal ESLint config.
This is meant to be used alongside Prettier (with
@imhoff/prettier-config
).
Usage
- Remove existing
.eslintrc.*
file, if present. Install
eslint
and the config.npm install -D eslint @imhoff/eslint-config
Add the following to
package.json
:"eslintConfig": { "extends": "@imhoff/eslint-config/recommended" },
:memo: You can also use the base rule set: @imhoff/eslint-config
With Prettier and @imhoff/prettier-config
- Set up Prettier and
@imhoff/prettier-config
. When using with Prettier and
@imhoff/prettier-config
, ESLint should run first. Set up your scripts inpackage.json
like this:"scripts": { "lint": "npm run eslint && npm run prettier -- --check", "fmt": "npm run eslint -- --fix && npm run prettier -- --write", "prettier": "prettier \"**/*.ts\"", "eslint": "eslint . --ext .ts", }
npm run lint
: for checking if ESLint and Prettier complainnpm run fmt
: attempt to autofix lint issues and autoformat code
:memo: Not every rule in this configuration is autofixable, so
npm run fmt
may continue failing until lint issues are addressed manually.
With Captain Hook
Install captainhook:
npm install -D captainhook
Add the following to
package.json
:"hooks": { "pre-commit": "npm run lint" },
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
5 years ago