You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[template-builtin-component-arguments](docs/rules/template-builtin-component-arguments.md)| disallow setting certain attributes on builtin components ||||
200
-
|[template-no-action-modifiers](docs/rules/template-no-action-modifiers.md)| disallow usage of {{action}} modifiers ||||
201
-
|[template-no-arguments-for-html-elements](docs/rules/template-no-arguments-for-html-elements.md)| disallow @arguments on HTML elements ||||
202
-
|[template-no-array-prototype-extensions](docs/rules/template-no-array-prototype-extensions.md)| disallow usage of Ember Array prototype extensions ||||
203
-
|[template-no-block-params-for-html-elements](docs/rules/template-no-block-params-for-html-elements.md)| disallow block params on HTML elements ||||
204
-
|[template-no-capital-arguments](docs/rules/template-no-capital-arguments.md)| disallow capital arguments (use lowercase @arg instead of @Arg) ||||
205
-
|[template-no-chained-this](docs/rules/template-no-chained-this.md)| disallow redundant `this.this` in templates || 🔧 ||
206
-
|[template-no-debugger](docs/rules/template-no-debugger.md)| disallow {{debugger}} in templates ||||
207
-
|[template-no-element-event-actions](docs/rules/template-no-element-event-actions.md)| disallow element event actions (use {{on}} modifier instead) ||||
208
-
|[template-no-inline-event-handlers](docs/rules/template-no-inline-event-handlers.md)| disallow DOM event handler attributes ||||
|[template-builtin-component-arguments](docs/rules/template-builtin-component-arguments.md)| disallow setting certain attributes on builtin components ||||
200
+
|[template-no-action-modifiers](docs/rules/template-no-action-modifiers.md)| disallow usage of {{action}} modifiers ||||
201
+
|[template-no-arguments-for-html-elements](docs/rules/template-no-arguments-for-html-elements.md)| disallow @arguments on HTML elements ||||
202
+
|[template-no-array-prototype-extensions](docs/rules/template-no-array-prototype-extensions.md)| disallow usage of Ember Array prototype extensions ||||
203
+
|[template-no-block-params-for-html-elements](docs/rules/template-no-block-params-for-html-elements.md)| disallow block params on HTML elements ||||
204
+
|[template-no-capital-arguments](docs/rules/template-no-capital-arguments.md)| disallow capital arguments (use lowercase @arg instead of @Arg) ||||
205
+
|[template-no-chained-this](docs/rules/template-no-chained-this.md)| disallow redundant `this.this` in templates || 🔧 ||
206
+
|[template-no-debugger](docs/rules/template-no-debugger.md)| disallow {{debugger}} in templates ||||
207
+
|[template-no-element-event-actions](docs/rules/template-no-element-event-actions.md)| disallow element event actions (use {{on}} modifier instead) ||||
208
+
|[template-no-inline-event-handlers](docs/rules/template-no-inline-event-handlers.md)| disallow DOM event handler attributes ||||
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
4
+
5
+
> **HBS Only**: This rule applies to classic `.hbs` template files only (loose mode). It is not relevant for `gjs`/`gts` files (strict mode), where these patterns cannot occur.
6
+
7
+
<!-- end auto-generated rule header -->
8
+
9
+
In Ember route templates, the model should be accessed via `this.model` in the controller or component, not as an `@model` argument. The `@model` argument pattern is more appropriate for components. This rule primarily targets `.hbs` files in the `templates/` directory.
10
+
11
+
## Rule Details
12
+
13
+
This rule disallows the use of `@model` argument in route templates (`.hbs` files in `templates/` directory).
14
+
15
+
## Examples
16
+
17
+
Examples of **incorrect** code for this rule (in route templates):
18
+
19
+
```hbs
20
+
<!-- app/templates/index.hbs -->
21
+
{{@model}}
22
+
```
23
+
24
+
```hbs
25
+
<!-- app/templates/users.hbs -->
26
+
{{@model.name}}
27
+
```
28
+
29
+
```hbs
30
+
<!-- app/templates/posts/show.hbs -->
31
+
{{@model.id}}
32
+
```
33
+
34
+
Examples of **correct** code for this rule:
35
+
36
+
```hbs
37
+
<!-- app/templates/index.hbs -->
38
+
{{this.model}}
39
+
```
40
+
41
+
```hbs
42
+
// app/components/user-card.gjs
43
+
{{@model.name}}
44
+
```
45
+
46
+
```hbs
47
+
{{this.model}}
48
+
```
49
+
50
+
## Migration
51
+
52
+
This rule includes a fixer in order to handle the migration for you automatically.
0 commit comments