Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 875 Bytes

no-obscure-array-access.md

File metadata and controls

27 lines (17 loc) · 875 Bytes

no-obscure-array-access

✅ The extends: 'recommended' property in a configuration file enables this rule.

🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

Using obscure expressions {{list.[1].name}} is discouraged and is likely to be deprecated soon. This rule recommends the use of Ember's get helper as an alternative for accessing array values.

Examples

This rule forbids the following:

<Foo @bar={{@list.[0]}} />

This rule allows the following:

<Foo @bar={{get @list '0'}} />

References