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

`no-deeply-nested-dependent-keys-with-each` rule should apply to computed macros that return an @each

Open jaydgruber opened this issue 5 years ago • 2 comments

filingRequestsUS: filterBy('filingRequests', 'data.country', 'US'),
// throws the runtime warning:
// WARNING: Dependent keys containing @each only work one level deep. 
// You used the key "[email protected]" which is invalid.
// Please create an intermediary computed property.

This throws a warning, but the lint rule does not catch it.

reduce_computed_macros that return an @each should trigger the lint rule as well. https://github.com/emberjs/ember.js/blob/23bf7e97502b0f9bab0e90914f4c944dcb7b0975/packages/ember-runtime/lib/computed/reduce_computed_macros.js#L397 As far as I can tell, this is just filterBy and mapBy

jaydgruber avatar Nov 08 '19 19:11 jaydgruber

Came here to file this. @bmish is there any plan to address this?

tehhowch avatar Nov 10 '22 16:11 tehhowch

Will need a volunteer to address it.

bmish avatar Nov 10 '22 18:11 bmish