# Why doesn’t AI Guard automatically fix empty catch blocks and floating promises?

Source: https://getaiguard.dev/guides/why-no-autofix · Last updated: 2026-11-14 · AI Guard 1.4.7

Because the only fix a tool can apply without understanding the code would hide the problem, not solve it. Inserting a `TODO` comment into an empty catch block, or `void` before an unawaited call, makes the finding disappear while the error is still swallowed, and an agent running `eslint --fix` would do exactly that. Since 1.4.7 these two rules offer editor suggestions that a person applies instead.

## What changed in 1.4.7

Before 1.4.7, `no-empty-catch` had an automatic fix that inserted `/* TODO: handle error */` and `no-floating-promise` had one that inserted `void`. Both made the lint finding go away. Neither handled the error. 1.4.7 removed both fixes.

```ts
// Before 1.4.7, eslint --fix turned this…
try {
  await saveOrder(order);
} catch (e) {}

// …into this. The error is still swallowed; the finding is gone.
try {
  await saveOrder(order);
} catch (e) { /* TODO: handle error */ }
```

An agent told to "make lint pass" runs `--fix`, sees a clean result and moves on. A guardrail that the agent can fix away is not a guardrail.

## What happens now

- **`no-empty-catch`** reports empty catch blocks, and also a catch block that contains only a `TODO`, `FIXME` or `XXX` comment, because those comments are not an explanation. A comment that explains why the error is ignored is accepted. Editors offer one suggestion: rethrow the error.
- **`no-floating-promise`** reports async calls that are not awaited, returned or handled with `.catch()`. Editors offer two suggestions: add `await` (inside an async function), or `void` for a call that really is fire-and-forget.

Suggestions are applied one at a time by a person in the editor; `eslint --fix` does not apply them. Code that relied on the old fixes will see these findings again after upgrading.

## Which rules still have automatic fixes

Three rules keep an automatic fix, because the fix changes the code in a way that does not hide a problem:

| Rule | What the fix does |
| --- | --- |
| [`no-hardcoded-secret`](https://getaiguard.dev/rules/no-hardcoded-secret) | Moves the value to `process.env` |
| [`no-await-in-loop`](https://getaiguard.dev/rules/no-await-in-loop) | Rewrites simple independent loops to `Promise.all` |
| [`no-invisible-unicode`](https://getaiguard.dev/rules/no-invisible-unicode) | Removes invisible characters from comments and escapes them in strings, templates and regexes |

## Sources

- [CHANGELOG.md](https://github.com/ai-guard-dev/eslint-plugin-ai-guard/blob/main/CHANGELOG.md)
- [docs/rules/no-empty-catch.md](https://github.com/ai-guard-dev/eslint-plugin-ai-guard/blob/main/docs/rules/no-empty-catch.md)
- [docs/rules/no-floating-promise.md](https://github.com/ai-guard-dev/eslint-plugin-ai-guard/blob/main/docs/rules/no-floating-promise.md)
