Skip to content

Latest commit

 

History

History
56 lines (37 loc) · 1.57 KB

no-unknown-arguments-for-builtin-components.md

File metadata and controls

56 lines (37 loc) · 1.57 KB

no-unknown-arguments-for-builtin-components

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