Skip to content

Commit 88e4e7b

Browse files
CopilotNullVoxPopuli
authored andcommitted
Port over ember-template-lint rule for gjs/gts
Revert .github changes Remove attribute indentation rule. We have prettier for formatting concerns Port over gjs/gts relevant ember-template-lint cleanup Add documentation and test files for removed ember rules
1 parent dbaf144 commit 88e4e7b

405 files changed

Lines changed: 22684 additions & 930 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.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ npm-debug.log
1414

1515
# eslint-remote-tester
1616
eslint-remote-tester-results
17+
package-lock.json

CHANGELOG.md

Lines changed: 1385 additions & 929 deletions
Large diffs are not rendered by default.

docs/rules/template-attribute-order.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ember/template-attribute-order
22

3+
💼 This rule is enabled in the following [configs](https://github.com/ember-cli/eslint-plugin-ember#-configurations): `strict-gjs`, `strict-gts`.
4+
35
<!-- end auto-generated rule header -->
46

57
Enforces a consistent ordering of attributes in template elements. This helps improve readability and maintainability of templates.

docs/rules/template-builtin-component-arguments.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ember/template-builtin-component-arguments
22

3+
💼 This rule is enabled in the following [configs](https://github.com/ember-cli/eslint-plugin-ember#-configurations): `strict-gjs`, `strict-gts`.
4+
35
<!-- end auto-generated rule header -->
46

57
✅ The `extends: 'recommended'` property in a configuration file enables this rule.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# ember/template-deprecated-inline-view-helper
2+
3+
💼 This rule is enabled in the following [configs](https://github.com/ember-cli/eslint-plugin-ember#-configurations): `strict-gjs`, `strict-gts`.
4+
5+
<!-- end auto-generated rule header -->
6+
7+
✅ The `extends: 'recommended'` property in a configuration file enables this rule.
8+
9+
In Ember 1.12, support for invoking the inline View helper was deprecated.
10+
11+
## Examples
12+
13+
This rule **forbids** the following:
14+
15+
```hbs
16+
{{view 'this-is-bad'}}
17+
18+
{{view.also-bad}}
19+
20+
{{qux-qaz please=view.stop}}
21+
22+
{{#not-this please=view.stop}}{{/not-this}}
23+
24+
<div foo={{view.bar}}></div>
25+
```
26+
27+
This rule **allows** the following:
28+
29+
```hbs
30+
{{this-is-better}}
31+
32+
{{qux-qaz this=good}}
33+
34+
{{#ok-this yay=nice}}{{/ok-this}}
35+
36+
<div foo={{bar}}></div>
37+
```
38+
39+
## References
40+
41+
- More information is available at the [Deprecation Guide](http://emberjs.com/deprecations/v1.x/#toc_ember-view).
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# ember/template-deprecated-render-helper
2+
3+
💼 This rule is enabled in the following [configs](https://github.com/ember-cli/eslint-plugin-ember#-configurations): `strict-gjs`, `strict-gts`.
4+
5+
<!-- end auto-generated rule header -->
6+
7+
Disallows the {{render}} helper which is deprecated.
8+
9+
## Examples
10+
11+
Incorrect:
12+
13+
```gjs
14+
<template>{{render "user"}}</template>
15+
```
16+
17+
Correct:
18+
19+
```gjs
20+
<template><User /></template>
21+
```
22+
23+
## References
24+
25+
- [ember-template-lint deprecated-render-helper](https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/deprecated-render-helper.md)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ember/template-inline-link-to
2+
3+
This rule has been removed from eslint-plugin-ember.

docs/rules/template-link-href-attributes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ember/template-link-href-attributes
22

3+
💼 This rule is enabled in the following [configs](https://github.com/ember-cli/eslint-plugin-ember#-configurations): `strict-gjs`, `strict-gts`.
4+
35
<!-- end auto-generated rule header -->
46

57
Requires `href` attribute on `<a>` elements.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# ember/template-modifier-name-case
2+
3+
💼 This rule is enabled in the following [configs](https://github.com/ember-cli/eslint-plugin-ember#-configurations): `strict-gjs`, `strict-gts`.
4+
5+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
6+
7+
<!-- end auto-generated rule header -->
8+
9+
Requires dasherized names for modifiers.
10+
11+
Modifiers should use dasherized names when being invoked, not camelCase. This is a stylistic rule that will prevent you from using camelCase modifiers, requiring you to use dasherized modifier names instead.
12+
13+
## Examples
14+
15+
This rule **forbids** the following:
16+
17+
```hbs
18+
<div {{didInsert}}></div>
19+
```
20+
21+
```hbs
22+
<div {{onFocus}}></div>
23+
```
24+
25+
```hbs
26+
<div {{modifier 'didInsert'}}></div>
27+
```
28+
29+
This rule **allows** the following:
30+
31+
```hbs
32+
<div {{did-insert}}></div>
33+
```
34+
35+
```hbs
36+
<div {{on-focus}}></div>
37+
```
38+
39+
```hbs
40+
<div {{modifier 'did-insert'}}></div>
41+
```
42+
43+
## See Also
44+
45+
- [named-functions-in-promises](named-functions-in-promises.md)
46+
47+
## References
48+
49+
- [Template syntax guide - Modifiers](https://guides.emberjs.com/release/components/template-syntax/#toc_modifiers)
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# ember/template-no-action-modifiers
2+
3+
💼 This rule is enabled in the following [configs](https://github.com/ember-cli/eslint-plugin-ember#-configurations): `strict-gjs`, `strict-gts`.
4+
5+
<!-- end auto-generated rule header -->
6+
7+
💼 This rule is enabled in the following [configs](https://github.com/ember-cli/eslint-plugin-ember#-configurations): `strict-gjs`, `strict-gts`.
8+
9+
Disallow usage of `{{action}}` modifiers in templates.
10+
11+
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.
12+
13+
## Rule Details
14+
15+
This rule disallows using `{{action}}` as an element modifier.
16+
17+
## Examples
18+
19+
### Incorrect ❌
20+
21+
```gjs
22+
<template>
23+
<button {{action "save"}}>Save</button>
24+
</template>
25+
```
26+
27+
```gjs
28+
<template>
29+
<div {{action "onClick"}}>Click me</div>
30+
</template>
31+
```
32+
33+
```gjs
34+
<template>
35+
<form {{action "submit" on="submit"}}>Submit</form>
36+
</template>
37+
```
38+
39+
### Correct ✅
40+
41+
```gjs
42+
<template>
43+
<button {{on "click" this.handleClick}}>Save</button>
44+
</template>
45+
```
46+
47+
```gjs
48+
<template>
49+
<div {{on "click" this.onClick}}>Click me</div>
50+
</template>
51+
```
52+
53+
```gjs
54+
<template>
55+
<form {{on "submit" this.handleSubmit}}>Submit</form>
56+
</template>
57+
```
58+
59+
## Related Rules
60+
61+
- [template-no-action](./template-no-action.md)
62+
63+
## References
64+
65+
- [Ember Octane Guide - Element Modifiers](https://guides.emberjs.com/release/components/template-lifecycle-dom-and-modifiers/)
66+
- [ember-template-lint: no-action](https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-action.md)

0 commit comments

Comments
 (0)