---
title: "lint/types/no-nullsafe-on-non-null"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="lint/types/no-nullsafe-on-non-null" />

In the [`code-quality`](/docs/rules/sets/code-quality) set. Safe fix.

## What it does

Cleanup unneeded nullsafe operator

## Configuration

```toml title="pun.toml"
[lint.rules]
"types/no-nullsafe-on-non-null" = "error"
```

To skip it in some files or lines, add an [override](/docs/configuration/pun-toml#lint) or an [ignore comment](/docs/configuration/ignore-comments).

## Replaces

- [`CleanupUnneededNullsafeOperator`](https://getrector.com/rule-detail/cleanup-unneeded-nullsafe-operator-rector) (rector)

[More lint/types rules](/docs/rules/lint/types) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
