eslint-config-love
eslint-config-love copied to clipboard
Rule clash between @typescript-eslint/init-declarations and no-undef-init
Given a stock config, local variables that may be undefined are impossible to lint:
// Variable 'x' should be initialized on declaration
// @typescript-eslint/init-declarations
let x: number | undefined
// It's not necessary to initialize 'x: number | undefined' to undefined
// no-undef-init
let x: number | undefined = undefined
The safer route is probably to turn off no-undef-init and allow superfluous initialization with undefined
? At least in Typescript.