# getter-return

Rule `eslint/getter-return`. Enforce `return` statements in getters

- Source: eslint
- Technologies: JavaScript
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 274.2M weekly downloads of presets that enable it
- Trend: +45.7% last quarter
- Rank: #36 by reach, #895 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `getter-return` | yes | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/getter-return) |
| Oxlint | `getter-return` | yes | no | plugin `eslint`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/getter-return.html) |
| Biome | `suspicious/useGetterReturn` | yes | no | group suspicious, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/use-getter-return/) |

## Code examples

### Incorrect: the rule reports this

```js
const p = {
    get name(){
        // no returns.
    }
};

Object.defineProperty(p, "age", {
    get: function (){
        // no returns.
    }
});

class P{
    get name(){
        // no returns.
    }
}
```

### Correct: the rule accepts this

```js
const p = {
    get name(){
        return "nicholas";
    }
};

Object.defineProperty(p, "age", {
    get: function (){
        return 18;
    }
});

class P{
    get name(){
        return "nicholas";
    }
}
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "getter-return": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "getter-return": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "suspicious": {
        "useGetterReturn": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [ESLint recommended](https://lintradar.dev/presets/eslint-recommended.md) | ESLint | `@eslint/js` | 64 | 178.8M | +25.9% |
| [Oxlint default](https://lintradar.dev/presets/oxlint-default.md) | Oxlint | `oxlint` | 111 | 50.8M | +183.6% |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Airbnb base](https://lintradar.dev/presets/airbnb-base.md) | ESLint | `eslint-config-airbnb-base` | 241 | 6.5M | +2.1% |
| [Create React App](https://lintradar.dev/presets/react-app.md) | ESLint | `eslint-config-react-app` | 109 | 4.1M | +4.3% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [Alloy](https://lintradar.dev/presets/alloy.md) | ESLint | `eslint-config-alloy` | 166 | 31.4K | +32.4% |

## Related rules

- [eslint/no-dupe-class-members](https://lintradar.dev/rules/eslint/no-dupe-class-members.md): Disallow duplicate class members
- [eslint/constructor-super](https://lintradar.dev/rules/eslint/constructor-super.md): Require `super()` calls in constructors
- [eslint/no-useless-backreference](https://lintradar.dev/rules/eslint/no-useless-backreference.md): Disallow useless backreferences in regular expressions
- [eslint/no-unused-vars](https://lintradar.dev/rules/eslint/no-unused-vars.md): Disallow unused variables
- [eslint/no-constant-condition](https://lintradar.dev/rules/eslint/no-constant-condition.md): Disallow constant expressions in conditions
- [eslint/no-class-assign](https://lintradar.dev/rules/eslint/no-class-assign.md): Disallow reassigning class members

---

Web page: https://lintradar.dev/rules/eslint/getter-return. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
