My favorite eslint configurations
$ npm add typescript eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-gb -D
// .eslintrc.js
module.exports = {
plugins: ['gb'],
extends: ['plugin:gb/recommended'],
};
Rule | Setting |
---|---|
@typescript-eslint/consistent-type-imports | warn |
@typescript-eslint/explicit-member-accessibility | warn |
@typescript-eslint/explicit-module-boundary-types | warn |
@typescript-eslint/member-ordering | warn (with alphabetical ordering) |
@typescript-eslint/no-unused-vars | off |
all of the recommended
rules and also the following.
Rule | Setting |
---|---|
@typescript-eslint/no-floating-promises | warn |
@typescript-eslint/unbound-method | error |