Skip to content

eslint/getter-return Nursery ​

What it does ​

Requires all getters to have a return statement

Why is this bad? ​

Getters should always return a value. If they don't, it's probably a mistake.

Example ​

javascript
class Person {
  get name() {
    // no return
  }
}

References ​

Released under the MIT License.