eslint-plugin-ember
eslint-plugin-ember copied to clipboard
`require-computed-macros` auto fixes to deprecated code
filteredItems: computed('[email protected]', function() {
return this.items.filterBy('isFiltered');
}),
Becomes:
filteredItems: computed.filterBy('items', 'isFiltered'),
However, computed. properties are deprecated per https://deprecations.emberjs.com/v3.x#toc_deprecated-run-loop-and-computed-dot-access.
It should be:
import { filterBy } from '@ember/object/computed';
// SNIP
filteredItems: computed.filterBy('items', 'isFiltered'),
Yeah I agree we should avoid adding computed.. But going along with this fix, we'll ideally need to add the import statement for the specific macro if missing.
PR welcome.