TypeScript Disallow Unecessary optional chain expression

Viewed 47

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

1 Answers
Related