This is my personal flat config for eslint for use in typescript projects.
This config is based on the AirBnB style guide, tweaked slightly for personal use case. You can click on any rule to view its corresponding eslint page.
There is still testing to be done mind you.
- security
- eslint - recommended
- import (Compat issue, WIP)
- tslint
Below is a list of the rules either changed, or omitted, with a reason for the change:
-
no-const-assign
: Typescript checker enforces this by default. -
no-new-object
- This rule is deprecated since ESLint v8.50.0, and they suggest using the newno-object-constructor
rule instead. -
prefer-destructuring
- Changed the array options tofalse
, as that does seem to bring up some indexing issues. -
no-useless-escape
- This rule is present in the extension ofeslint:recommended
. -
wrap-iife
- This rule is deprecated since ESLint V8.53.0, and is not a concern when ES6 modules are involved. -
no-dupe-class-members
- This rule is present in the extension ofeslint:recommended
. -
no-undef
- This rule is present in the extension ofeslint:recommended
. -
no-unused-vars
- This rule is present in the extension ofeslint:recommended
. -
no-case-declarations
- This rule is present in the extension ofeslint:recommended
. -
camelcase
- I opted to ignore this check, as I use my own style conventions when writing, and will have that uploaded somewhere.
The following rules are best handled by formatters like prettier
, to avoid clashing with external libraries, and to allow some encapsulation.
no-confusing-arrow
arrow-body-style
function-paren-newline
space-before-blocks
space-before-function-paren
arrow-parens
template-curly-spacing
quotes
quote-props
implicit-arrow-linebreak
no-nested-ternary
no-mixed-operators
nonblock-statement-body-position
brace-style
spaced-comment
- Everything in the Whitespace section.
Requires ES2018 support minimum