getter-return
Configuration
rslint.config.ts
Rule Details
Enforces that property getters contain a return statement that returns a value. This applies to getter methods in object literals, class declarations, and property descriptors passed to Object.defineProperty, Object.defineProperties, Reflect.defineProperty, and Object.create.
Options
allowImplicit(default:false): When set totrue, allows getters to implicitly returnundefinedby usingreturn;without a value.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Examples of correct code with { allowImplicit: true }: