Restrict assignment in if statements in Typescript
Asked Answered
A

1

5

Recently I caught a nasty bug caused by assignment in If statement. I consider if-assignment as a bad pattern for me and I want to turn it off completely to get the compiler varnings instead of actual bugs.

How can I do this in Typescript?

Assimilable answered 24/12, 2018 at 20:55 Comment(0)
A
6

I have found this option in TSLinter: https://palantir.github.io/tslint/rules/no-conditional-assignment/

Assimilable answered 24/12, 2018 at 21:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.