# TS1345: An expression of type 'void' cannot be tested for truthiness.

> The result of a `void` function is used as a condition. A `void` value is never meaningful to test; call the function and test something else.

## What it means

An expression of type `void` is used in `if`, `while`, `&&`, `||`, `!` or a conditional
expression. A function typed `void` returns nothing useful, so testing it is almost always a
mistake, such as testing a callback's result instead of calling a predicate.

## Example

```ts
function save(): void {}

if (save()) {
  console.log("saved");
}
```

## How to fix

- Call the function on its own line and test a real condition.
- If the function does return a meaningful value, change its return type (for example to
  `boolean`).

Source: https://ts-r.dev/errors/TS1345/
