@imhoff/eslint-config
v4.0.5
Published
My personal ESLint config.
Maintainers
Readme
@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
eslintand the config.npm install -D eslint @imhoff/eslint-configAdd 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.jsonlike 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 fmtmay continue failing until lint issues are addressed manually.
With Captain Hook
Install captainhook:
npm install -D captainhookAdd the following to
package.json:"hooks": { "pre-commit": "npm run lint" },
