2 title: no-setter-return
8 - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set
13 Setters cannot return values.
15 While returning a value from a setter does not produce an error, the returned value is being ignored. Therefore, returning a value from a setter is either unnecessary or a possible error, since the returned value cannot be used.
19 This rule disallows returning values from setters and reports `return` statements in setter functions.
21 Only `return` without a value is allowed, as it's a control flow statement.
23 This rule checks setters in:
26 * Class declarations and class expressions.
27 * Property descriptors in `Object.create`, `Object.defineProperty`, `Object.defineProperties`, and `Reflect.defineProperty` methods of the global objects.
29 Examples of **incorrect** code for this rule:
34 /*eslint no-setter-return: "error"*/
60 Object.defineProperty(foo, "bar", {
72 Examples of **correct** code for this rule:
77 /*eslint no-setter-return: "error"*/
101 Object.defineProperty(foo, "bar", {
104 throw new Error("Negative value.");