Skip to content
public-library›Rules›TypeScript›Use Boolean() for explicit boolean coercion

Use Boolean() for explicit boolean coercion

When code intentionally converts a value to a boolean from its truthiness, write Boolean(value) instead of !!value. When the condition has a specific meaning, such as "present" or "non-empty", write that comparison instead of coercing.

In the full rule