---
title: "lint/style/prefer-property-over-local-getter"
pagination: false
---

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

<RuleId id="lint/style/prefer-property-over-local-getter" />

In the [`privatization`](/docs/rules/sets/privatization) set. Unsafe fix: it can change behaviour.

## What it does

Privatize getter of local property to property

## Configuration

```toml title="pun.toml"
[lint.rules]
"style/prefer-property-over-local-getter" = "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

- [`PrivatizeLocalGetterToProperty`](https://getrector.com/rule-detail/privatize-local-getter-to-property-rector) (rector)

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