eslint-plugin-ember icon indicating copy to clipboard operation
eslint-plugin-ember copied to clipboard

Forbid accessing this.args in class-body space

Open NullVoxPopuli opened this issue 2 months ago • 1 comments

bad:

class extends Component {
  // non-reactive!
  foo = this.args.foo;
}

good:

class extends Component {
  // lazy, reactive
  get foo() {
    return this.args.foo;
  }
}

NullVoxPopuli avatar Nov 06 '25 15:11 NullVoxPopuli

Seems reasonable to me. Might want to discuss a bit more if we want it on by default.

wagenet avatar Nov 06 '25 15:11 wagenet