Skip to content

Commit ea04d83

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
1 parent ca9741c commit ea04d83

File tree

417 files changed

+22983
-958
lines changed

Some content is hidden

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

417 files changed

+22983
-958
lines changed

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

README.md

Lines changed: 179 additions & 29 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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
## Examples
8+
9+
See ember-template-lint documentation.
10+
11+
## References
12+
13+
- [ember-template-lint](https://github.com/ember-template-lint/ember-template-lint)
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: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# ember/template-inline-link-to
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+
Disallows the inline form of the `link-to` component and enforces the block form instead.
10+
11+
Ember's `link-to` component has both an inline form and a block form. This rule forbids the inline form.
12+
13+
## Examples
14+
15+
This rule **forbids** the following (inline form):
16+
17+
```hbs
18+
{{link-to 'Link text' 'routeName' prop1 prop2}}
19+
```
20+
21+
This rule **allows** the following (block form):
22+
23+
```hbs
24+
{{#link-to 'routeName' prop1 prop2}}Link text{{/link-to}}
25+
```
26+
27+
## Rationale
28+
29+
The block form is a little longer but has advantages over the inline form:
30+
31+
- It maps closer to the use of HTML anchor tags which wrap their inner content.
32+
- It provides an obvious way for developers to put nested markup and components inside of their link.
33+
- The block form's argument order is more direct: "link to route". The inline form's argument order is somewhat ambiguous (link text then link target). This is opposite of the order in HTML (`href` then link text).
34+
35+
## References
36+
37+
- [Ember guides/routing](https://guides.emberjs.com/release/routing/linking-between-routes/#toc_the-linkto--component)
38+
- [Ember api/LinkTo component](https://api.emberjs.com/ember/release/classes/Ember.Templates.components/methods/LinkTo?anchor=LinkTo)

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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# ember/template-link-rel-noopener
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+
## Examples
10+
11+
See ember-template-lint documentation.
12+
13+
## References
14+
15+
- [ember-template-lint link-rel-noopener](https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/link-rel-noopener.md)

0 commit comments

Comments
 (0)