Skip to content

Commit 5b880e4

Browse files
committed
Fix
1 parent 6a1f6be commit 5b880e4

192 files changed

Lines changed: 813 additions & 774 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 274 additions & 273 deletions
Large diffs are not rendered by default.

docs/rules/template-deprecated-inline-view-helper.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

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

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+
57
In Ember 1.12, support for invoking the inline View helper was deprecated.
68

79
## Rule Details
@@ -12,24 +14,20 @@ This rule flags `{{view}}` mustache or block statements that have hash pair argu
1214

1315
This rule **forbids** the following:
1416

15-
```gjs
16-
<template>
17-
{{view 'this-is-bad' tagName="span"}}
17+
```hbs
18+
{{view 'this-is-bad' tagName='span'}}
1819
19-
{{#view tagName="span"}}content{{/view}}
20-
</template>
20+
{{#view tagName='span'}}content{{/view}}
2121
```
2222

2323
This rule **allows** the following:
2424

25-
```gjs
26-
<template>
27-
{{this-is-better}}
25+
```hbs
26+
{{this-is-better}}
2827
29-
{{qux-qaz this=good}}
28+
{{qux-qaz this=good}}
3029
31-
<div foo={{bar}}></div>
32-
</template>
30+
<div foo={{bar}}></div>
3331
```
3432

3533
## References

docs/rules/template-deprecated-render-helper.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22

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

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+
57
Disallows the {{render}} helper which is deprecated.
68

79
## Examples
810

911
Incorrect:
1012

11-
```gjs
12-
<template>{{render "user"}}</template>
13+
```hbs
14+
{{render 'user'}}
1315
```
1416

1517
Correct:
1618

17-
```gjs
18-
<template><User /></template>
19+
```hbs
20+
<User />
1921
```
2022

2123
## References

docs/rules/template-no-action-modifiers.md

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

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

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+
57
Disallow usage of `{{action}}` modifiers in templates.
68

79
The `{{action}}` modifier has been deprecated in favor of the `{{on}}` modifier. The `{{on}}` modifier provides a more explicit and flexible way to handle events.
@@ -14,42 +16,30 @@ This rule disallows using `{{action}}` as an element modifier.
1416

1517
### Incorrect ❌
1618

17-
```gjs
18-
<template>
19-
<button {{action "save"}}>Save</button>
20-
</template>
19+
```hbs
20+
<button {{action 'save'}}>Save</button>
2121
```
2222

23-
```gjs
24-
<template>
25-
<div {{action "onClick"}}>Click me</div>
26-
</template>
23+
```hbs
24+
<div {{action 'onClick'}}>Click me</div>
2725
```
2826

29-
```gjs
30-
<template>
31-
<form {{action "submit" on="submit"}}>Submit</form>
32-
</template>
27+
```hbs
28+
<form {{action 'submit' on='submit'}}>Submit</form>
3329
```
3430

3531
### Correct ✅
3632

37-
```gjs
38-
<template>
39-
<button {{on "click" this.handleClick}}>Save</button>
40-
</template>
33+
```hbs
34+
<button {{on 'click' this.handleClick}}>Save</button>
4135
```
4236

43-
```gjs
44-
<template>
45-
<div {{on "click" this.onClick}}>Click me</div>
46-
</template>
37+
```hbs
38+
<div {{on 'click' this.onClick}}>Click me</div>
4739
```
4840

49-
```gjs
50-
<template>
51-
<form {{on "submit" this.handleSubmit}}>Submit</form>
52-
</template>
41+
```hbs
42+
<form {{on 'submit' this.handleSubmit}}>Submit</form>
5343
```
5444

5545
## Related Rules

docs/rules/template-no-action.md

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

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

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+
57
Disallows the use of `{{action}}` helper.
68

79
The `{{action}}` helper is deprecated in favor of the `{{on}}` modifier and `{{fn}}` helper, which provide better performance and clearer intent.
@@ -10,36 +12,26 @@ The `{{action}}` helper is deprecated in favor of the `{{on}}` modifier and `{{f
1012

1113
Examples of **incorrect** code for this rule:
1214

13-
```gjs
14-
<template>
15-
<button {{on "click" (action "save")}}>Save</button>
16-
</template>
15+
```hbs
16+
<button {{on 'click' (action 'save')}}>Save</button>
1717
```
1818

19-
```gjs
20-
<template>
21-
{{action "doSomething"}}
22-
</template>
19+
```hbs
20+
{{action 'doSomething'}}
2321
```
2422

2523
Examples of **correct** code for this rule:
2624

27-
```gjs
28-
<template>
29-
<button {{on "click" this.save}}>Save</button>
30-
</template>
25+
```hbs
26+
<button {{on 'click' this.save}}>Save</button>
3127
```
3228

33-
```gjs
34-
<template>
35-
<button {{on "click" (fn this.save "arg")}}>Save with arg</button>
36-
</template>
29+
```hbs
30+
<button {{on 'click' (fn this.save 'arg')}}>Save with arg</button>
3731
```
3832

39-
```gjs
40-
<template>
41-
{{this.action}}
42-
</template>
33+
```hbs
34+
{{this.action}}
4335
```
4436

4537
## Migration
@@ -49,9 +41,9 @@ Examples of **correct** code for this rule:
4941

5042
## Related Rules
5143

52-
* [no-action-modifiers](template-no-action-modifiers.md)
53-
* [no-element-event-actions](template-no-element-event-actions.md)
54-
* [no-mut-helper](template-no-mut-helper.md)
44+
- [no-action-modifiers](template-no-action-modifiers.md)
45+
- [no-element-event-actions](template-no-element-event-actions.md)
46+
- [no-mut-helper](template-no-mut-helper.md)
5547

5648
## References
5749

docs/rules/template-no-ambiguous-glimmer-paths.md

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

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

5-
> Disallow ambiguous path in templates
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+
Disallow ambiguous path in templates
68

79
## Rule Details
810

@@ -12,36 +14,26 @@ This rule requires explicit `this.` or `@` prefix for property access to avoid a
1214

1315
Examples of **incorrect** code for this rule:
1416

15-
```gjs
16-
<template>
17-
{{user.name}}
18-
</template>
17+
```hbs
18+
{{user.name}}
1919
```
2020

21-
```gjs
22-
<template>
23-
{{model.title}}
24-
</template>
21+
```hbs
22+
{{model.title}}
2523
```
2624

2725
Examples of **correct** code for this rule:
2826

29-
```gjs
30-
<template>
31-
{{this.user.name}}
32-
</template>
27+
```hbs
28+
{{this.user.name}}
3329
```
3430

35-
```gjs
36-
<template>
37-
{{@model.title}}
38-
</template>
31+
```hbs
32+
{{@model.title}}
3933
```
4034

41-
```gjs
42-
<template>
43-
{{MyComponent}}
44-
</template>
35+
```hbs
36+
{{MyComponent}}
4537
```
4638

4739
## References

docs/rules/template-no-at-ember-render-modifiers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import { modifier } from 'ember-modifier';
5050

5151
export default class MyComponent extends Component {
5252
myModifier = modifier((element) => {
53-
let handleEvent = () => {};
53+
const handleEvent = () => {};
5454

5555
element.addEventListener('eventName', handleEvent);
5656

docs/rules/template-no-attrs-in-components.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22

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

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+
57
This rule prevents the usage of `this.attrs` property to access values passed to the component. Use `@arg` syntax instead.
68

79
## Examples
810

911
This rule **forbids** the following:
1012

11-
```gjs
12-
<template>{{this.attrs.foo}}</template>
13+
```hbs
14+
{{this.attrs.foo}}
1315
```
1416

1517
This rule **allows** the following:
1618

17-
```gjs
18-
<template>{{@foo}}</template>
19+
```hbs
20+
{{@foo}}
1921
```
2022

2123
## References

docs/rules/template-no-builtin-form-components.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ export default class MyComponent extends Component {
4949
```
5050

5151
```hbs
52-
<form {{on "input" this.handleInput}}>
53-
<label> Name
54-
<input name="name">
52+
<form {{on 'input' this.handleInput}}>
53+
<label>
54+
Name
55+
<input name='name' />
5556
</label>
5657
</form>
5758
```
@@ -76,16 +77,12 @@ export default class MyComponent extends Component {
7677
```
7778

7879
```hbs
79-
<input
80-
type="text"
81-
value={{this.name}}
82-
{{on "input" this.updateName}}
83-
/>
80+
<input type='text' value={{this.name}} {{on 'input' this.updateName}} />
8481
```
8582

8683
## Related Rules
8784

88-
* [no-mut-helper](template-no-mut-helper.md)
85+
- [no-mut-helper](template-no-mut-helper.md)
8986

9087
## References
9188

docs/rules/template-no-class-bindings.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,34 @@
22

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

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+
57
Disallow passing `classBinding` or `classNameBindings` as arguments within templates. These are legacy Ember Classic patterns that should be replaced with modern approaches.
68

79
## Examples
810

911
This rule **forbids** the following:
1012

11-
```gjs
12-
<template><SomeThing @classBinding="isActive:active" /></template>
13+
```hbs
14+
<SomeThing @classBinding='isActive:active' />
1315
```
1416

15-
```gjs
16-
<template>{{some-thing classNameBindings="isActive:active:inactive"}}</template>
17+
```hbs
18+
{{some-thing classNameBindings='isActive:active:inactive'}}
1719
```
1820

19-
```gjs
20-
<template><SomeThing @classNameBindings="isActive:active:inactive" /></template>
21+
```hbs
22+
<SomeThing @classNameBindings='isActive:active:inactive' />
2123
```
2224

2325
This rule **allows** the following:
2426

25-
```gjs
26-
<template><SomeThing class={{if this.isActive "active"}} /></template>
27+
```hbs
28+
<SomeThing class={{if this.isActive 'active'}} />
2729
```
2830

29-
```gjs
30-
<template><SomeThing /></template>
31+
```hbs
32+
<SomeThing />
3133
```
3234

3335
## Migration

0 commit comments

Comments
 (0)