Remove the code style rule about casts to bool
This commit is contained in:
parent
29bd206f85
commit
67401eeb27
1 changed files with 0 additions and 11 deletions
|
@ -113,17 +113,6 @@ Unless otherwise specified, the following applies to all code:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
14. Explicitly cast to a boolean, rather than relying on implicit truthiness of non-boolean values:
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
const isRealUser = !!userId && ...;
|
|
||||||
// ... or ...
|
|
||||||
const isRealUser = Boolean(userId) && ...;
|
|
||||||
|
|
||||||
// but *not*:
|
|
||||||
const isRealUser = userId && ...; // invalid implicit cast
|
|
||||||
```
|
|
||||||
|
|
||||||
15. Use `switch` statements when checking against more than a few enum-like values.
|
15. Use `switch` statements when checking against more than a few enum-like values.
|
||||||
16. Use `const` for constants, `let` for mutability.
|
16. Use `const` for constants, `let` for mutability.
|
||||||
17. Describe types exhaustively (ensure noImplictAny would pass).
|
17. Describe types exhaustively (ensure noImplictAny would pass).
|
||||||
|
|
Loading…
Add table
Reference in a new issue