Is there an es lint rule or typescript config to disallow the following ?
let s: string;
s = 'a';
s?.toLocaleLowerCase();
In my opinion, s is not nullable so no need to do optional chain assertion, it just confuses other developers
Is there an es lint rule or typescript config to disallow the following ?
let s: string;
s = 'a';
s?.toLocaleLowerCase();
In my opinion, s is not nullable so no need to do optional chain assertion, it just confuses other developers
Share Improve this question asked May 6, 2022 at 11:00 TSRTSR 20.9k32 gold badges120 silver badges240 bronze badges1 Answer
Reset to default 5The typescript-eslint/no-unnecessary-condition
rule does this.