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

`require-computed-macros` auto fixes to deprecated code

Open wagenet opened this issue 3 years ago • 1 comments

	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'),

wagenet avatar Oct 04 '22 15:10 wagenet

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.

bmish avatar Oct 04 '22 16:10 bmish