when firstObject / lastObject / .0. are part of a string path inside a get, the fixer treats these as properties, where in reality these are ember syntax from array prototype extensions. These paths should either be ignored entirely, or changed to use array access.
// original
get(this, 'foo.firstObject.bar')
// bad ❌
this.foo.firstObject.bar;
// good ✅
this.foo[0].bar;
Same applies for lastObject and array based access foo.0.bar, which are all ember-specifics.
we have 2 options:
- update the fixer to ignore any path containing
firstObject / lastObject / .0.
- update the fixer to convert these paths into array access like mentioned above.
could even do a combination of the above where they are only fixed if you specify a new configuration option like handleEmberArrayPrototypes
@lin-ll @bmish any thoughts here?
when
firstObject/lastObject/.0.are part of a string path inside aget, the fixer treats these as properties, where in reality these are ember syntax from array prototype extensions. These paths should either be ignored entirely, or changed to use array access.Same applies for
lastObjectand array based accessfoo.0.bar, which are all ember-specifics.we have 2 options:
firstObject/lastObject/.0.could even do a combination of the above where they are only fixed if you specify a new configuration option like
handleEmberArrayPrototypes@lin-ll @bmish any thoughts here?