💼 This rule is enabled in the ✅ recommended
config.
🔧 This rule is automatically fixable by the --fix
CLI option.
This rule attempts to find incorrect usages of computed property macros, such as calling them with the incorrect number of arguments.
It currently only catches using the and and or macros with the wrong number of arguments, but may be expanded later.
Examples of incorrect code for this rule:
import { and, or } from '@ember/object/computed';
export default Component.extend({
macroPropertyAnd: and('someProperty'), // Not enough arguments.
macroPropertyOr: or('someProperty') // Not enough arguments.
});
Examples of correct code for this rule:
import { and, or, readOnly } from '@ember/object/computed';
export default Component.extend({
macroPropertyReadOnly: readOnly('someProperty'),
macroPropertyAnd: and('someProperty1', 'someProperty2'),
macroPropertyOr: or('someProperty1', 'someProperty2')
});