Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 1.07 KB

no-redundant-fn.md

File metadata and controls

35 lines (23 loc) · 1.07 KB

no-redundant-fn

✅ 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.

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