TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

TsLint: assignment operation inside an 'if' condition should be marked with a warning

Open AGiorgetti opened this issue 11 years ago • 2 comments

If we want to spot some more bugs at compile time, I believe that something like:

if (data.id = id) { ...

while being perfectly legal, it can be a coding bug most of the times. it would be nice if TsLint could spot this type of code and give us a warning instead of using a custom regex that scan all our files.

AGiorgetti avatar Jul 16 '15 10:07 AGiorgetti

TSLint issues should be reported here: https://github.com/palantir/tslint/ as that isn't a Microsoft thing :) Definitely nice to have! :)

DickvdBrink avatar Jul 16 '15 12:07 DickvdBrink

ops sorry, will open the ticket there, thanks!

AGiorgetti avatar Jul 16 '15 13:07 AGiorgetti