Skip to content

Latest commit

 

History

History
58 lines (38 loc) · 1.73 KB

File metadata and controls

58 lines (38 loc) · 1.73 KB

ember/template-no-unknown-arguments-for-builtin-components

💼 This rule is enabled in the 📋 template-lint-migration config.

🔧 This rule is automatically fixable by the --fix CLI option.

The builtin components LinkTo, Input, Textarea has list of allowed arguments, and some argument names may be mistyped, this rule trying to highlight possible typos, checking for unknown arguments, also, some components has conflicted and required arguments, rule addressing this behavior.

This rule warns about unknown, required and conflicted arguments for LinkTo, Input, Textarea components.

Examples

This rule forbids the following:

<LinkTo @unsupportedArgument='foo'> some link with unknown argument</LinkTo>
<LinkTo @route='info' @model='a' @models='b'> info </LinkTo>
<LinkTo @models='b'> info </LinkTo>
<Input @foo='bar' />
<Textarea @foo='bar' />

This rule allows the following:

<LinkTo @route='readme'> readme </LinkTo>
<Input @value='someValue' />
<Textarea @value='someValue' />

Migration

  • Check references section to get allowed arguments list.
  • If argument represents html attribute, remove @ from name.

Related Rules

References