Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 952 Bytes

File metadata and controls

30 lines (19 loc) · 952 Bytes

ember/template-no-redundant-fn

The fn helper can be used to bind arguments to another function. Using it without any arguments is redundant because then the inner function could just be used directly.

This rule is looking for fn helper usages that don't provide any additional arguments to the inner function and warns about them.

Examples

This rule forbids the following:

<button {{on 'click' (fn this.handleClick)}}>Click Me</button>

This rule allows the following:

<button {{on 'click' this.handleClick}}>Click Me</button>
<button {{on 'click' (fn this.handleClick 'foo')}}>Click Me</button>

References