eslint-plugin-ember
eslint-plugin-ember copied to clipboard
New Rule: `no-simple-alias`
A new rule disallowing oneWay reads and readOnly off of another prop on the same context.
import Component from '@glimmer/component';
import { oneWay, reads, readOnly } from '@ember/object/computed';
export default MyComponent extends Component {
aProp = true;
// BAD
@oneWay('aProp') oneWayProp;
@reads('aProp') readsProp;
@readOnly('aProp') readOnlyProp;
// OK
@oneWay('args.aProp') oneWayProp;
@reads('args.aProp') readsProp;
@readOnly('args.aProp') readOnlyProp;
}
Ya, seems good to me. TBH, having many aliases for a local property is just very very confusing.