Skip to content

Commit 988d1ee

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 feat(rules): add template-require-valid-form-groups and template-template-length rules - Introduced `template-require-valid-form-groups` rule to enforce proper grouping of form controls using `<fieldset>`/`<legend>` or WAI-ARIA roles. - Added `template-template-length` rule to enforce size constraints on templates, allowing configuration for minimum and maximum line lengths. - Updated documentation for existing rules to include configuration details. - Added tests for both new rules to ensure correct functionality and error reporting. Cleanup Fix fix Update documentation links from ember-template-lint to eslint-plugin-ember - Changed references in various rule documentation files to point to the new eslint-plugin-ember URLs instead of ember-template-lint. - Updated tests to reflect the change in rule naming conventions. Add scope checking to template-no-arguments-for-html-elements Fix oof
1 parent 688cf6b commit 988d1ee

391 files changed

Lines changed: 24924 additions & 997 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/no-array-prototype-extensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,6 @@ arr.uniq();
139139

140140
## Related Rules
141141

142-
- [no-array-prototype-extensions](https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-array-prototype-extensions.md) from ember-template-lint
142+
- [template-no-array-prototype-extensions](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/template-no-array-prototype-extensions.md) from eslint-plugin-ember
143143
- [no-function-prototype-extensions](no-function-prototype-extensions.md)
144144
- [no-string-prototype-extensions](no-string-prototype-extensions.md)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ import didUpdate from '@ember/render-modifiers/modifiers/did-update';
4545
import willDestroy from '@ember/render-modifiers/modifiers/will-destroy';
4646
```
4747

48-
For more examples, see [the docs on ember-template-lint](https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-at-ember-render-modifiers.md).
48+
For more examples, see [the docs on eslint-plugin-ember](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/template-no-at-ember-render-modifiers.md).
4949

5050
## References
5151

5252
- [Editions](https://emberjs.com/editions/)
5353
- [Octane Upgrade Guide](https://guides.emberjs.com/release/upgrading/current-edition/)
5454
- [Component Documentation](https://guides.emberjs.com/release/components/)
5555
- [Avoiding Lifecycle in Component](https://nullvoxpopuli.com/avoiding-lifecycle)
56-
- [The `ember-template-lint` version of this rule](https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-at-ember-render-modifiers.md)
56+
- [The `eslint-plugin-ember` version of this rule](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/template-no-at-ember-render-modifiers.md)
5757
- [`ember-modifier`](https://github.com/ember-modifier/ember-modifier)
5858
- [`@ember/render-modifiers`](https://github.com/emberjs/ember-render-modifiers) (deprecated)

docs/rules/no-html-safe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export default helper(substring);
109109

110110
## Related Rules
111111

112-
- ember-template-lint has a [no-triple-curlies](https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-triple-curlies.md) rule for the template equivalent of this rule.
112+
- eslint-plugin-ember has a [template-no-triple-curlies](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/template-no-triple-curlies.md) rule for the template equivalent of this rule.
113113

114114
## References
115115

docs/rules/no-restricted-service-injections.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ Accepts an array of the objects with the following options:
6060
## Related Rules
6161

6262
- The [no-restricted-imports](https://eslint.org/docs/rules/no-restricted-imports) or [import/no-restricted-paths](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-restricted-paths.md) rules are the JavaScript import statement equivalent of this rule.
63-
- ember-template-lint has a [no-restricted-invocations](https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-restricted-invocations.md) rule for disallowing component usages.
63+
- eslint-plugin-ember has a [template-no-restricted-invocations](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/template-no-restricted-invocations.md) rule for disallowing component usages.

docs/rules/template-attribute-order.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,21 @@ Examples of **correct** code for this rule:
4949
</template>
5050
```
5151

52-
## Configuration
52+
## Options
5353

54-
You can customize the order by providing an `order` array:
54+
| Name | Type | Default | Description |
55+
| ------------- | ---------- | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
56+
| `order` | `string[]` | `["arguments", "attributes", "modifiers"]` | The order of token type groups. Valid values: `"arguments"`, `"attributes"`, `"modifiers"`, `"splattributes"`, `"comments"`. |
57+
| `alphabetize` | `boolean` | `true` | Whether to alphabetize attributes within each group. |
5558

5659
```js
5760
module.exports = {
5861
rules: {
5962
'ember/template-attribute-order': [
6063
'error',
6164
{
62-
order: ['class', 'id', 'role', 'aria-', 'type'],
65+
order: ['arguments', 'attributes', 'modifiers'],
66+
alphabetize: true,
6367
},
6468
],
6569
},
@@ -68,4 +72,4 @@ module.exports = {
6872

6973
## References
7074

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ Examples of **correct** code for this rule:
5656

5757
- [MDN: The Anchor element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a)
5858
- [WebAIM: Links and Hypertext](https://webaim.org/techniques/hypertext/)
59-
- [ember-template-lint link-href-attributes](https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/link-href-attributes.md)
59+
- [eslint-plugin-ember template-link-href-attributes](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/template-link-href-attributes.md)

0 commit comments

Comments
 (0)