Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,14 @@ rules in templates can be disabled with eslint directives with mustache or html

### Possible Errors

| Name                                     | Description | 💼 | 🔧 | 💡 |
| :------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------- | :- | :- | :- |
| [template-no-extra-mut-helper-argument](docs/rules/template-no-extra-mut-helper-argument.md) | disallow passing more than one argument to the mut helper | | | |
| [template-no-jsx-attributes](docs/rules/template-no-jsx-attributes.md) | disallow JSX-style camelCase attributes | | 🔧 | |
| [template-no-scope-outside-table-headings](docs/rules/template-no-scope-outside-table-headings.md) | disallow scope attribute outside th elements | | | |
| [template-no-shadowed-elements](docs/rules/template-no-shadowed-elements.md) | disallow ambiguity with block param names shadowing HTML elements | | | |
| [template-no-unbalanced-curlies](docs/rules/template-no-unbalanced-curlies.md) | disallow unbalanced mustache curlies | | | |
| Name                                                 | Description | 💼 | 🔧 | 💡 |
| :------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------- | :- | :- | :- |
| [template-no-extra-mut-helper-argument](docs/rules/template-no-extra-mut-helper-argument.md) | disallow passing more than one argument to the mut helper | | | |
| [template-no-jsx-attributes](docs/rules/template-no-jsx-attributes.md) | disallow JSX-style camelCase attributes | | 🔧 | |
| [template-no-scope-outside-table-headings](docs/rules/template-no-scope-outside-table-headings.md) | disallow scope attribute outside th elements | | | |
| [template-no-shadowed-elements](docs/rules/template-no-shadowed-elements.md) | disallow ambiguity with block param names shadowing HTML elements | | | |
| [template-no-unbalanced-curlies](docs/rules/template-no-unbalanced-curlies.md) | disallow unbalanced mustache curlies | | | |
| [template-no-unknown-arguments-for-builtin-components](docs/rules/template-no-unknown-arguments-for-builtin-components.md) | disallow unknown arguments for built-in components | | | |

### Routes

Expand Down
54 changes: 54 additions & 0 deletions docs/rules/template-no-unknown-arguments-for-builtin-components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# ember/template-no-unknown-arguments-for-builtin-components

<!-- end auto-generated rule header -->

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:

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

```hbs
<Input @foo='bar' />
```

```hbs
<Textarea @foo='bar' />
```

This rule **allows** the following:

```hbs
<LinkTo @route='readme'> readme </LinkTo>
```

```hbs
<Input @value='someValue' />
```

```hbs
<Textarea @value='someValue' />
```

## Migration

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

## Related Rules

- [no-link-to-tagname](template-no-link-to-tagname.md)
- [no-input-tagname](template-no-input-tagname.md)
- [builtin-component-arguments](template-builtin-component-arguments.md)

## References

- [Reduce API Surface of Built-In Components](https://github.com/emberjs/rfcs/blob/master/text/0707-modernize-built-in-components-2.md#summary)
Loading
Loading