Skip to content

Commit dfd8fa2

Browse files
committed
feat: add originallyFrom metadata to template rules
- Added `originallyFrom` metadata to various template rules to indicate their origin from ember-template-lint. - This includes details such as the rule name, documentation path, and test file path for better traceability and understanding of rule origins.
1 parent 6d33aa0 commit dfd8fa2

123 files changed

Lines changed: 736 additions & 3 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.

lib/rules/template-attribute-order.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ module.exports = {
9696
notAlphabetized: '{{tokenType}} "{{source}}" is not alphabetized.',
9797
hashPairOrder: '`{{name}}` must appear after `{{expectedAfter}}`.',
9898
},
99+
originallyFrom: {
100+
name: 'ember-template-lint',
101+
rule: 'lib/rules/attribute-order.js',
102+
docs: 'docs/rule/attribute-order.md',
103+
tests: 'test/unit/rules/attribute-order-test.js',
104+
},
99105
},
100106

101107
create(context) {

lib/rules/template-builtin-component-arguments.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ module.exports = {
2121
fixable: null,
2222
schema: [],
2323
messages: {},
24+
originallyFrom: {
25+
name: 'ember-template-lint',
26+
rule: 'lib/rules/builtin-component-arguments.js',
27+
docs: 'docs/rule/builtin-component-arguments.md',
28+
tests: 'test/unit/rules/builtin-component-arguments-test.js',
29+
},
2430
},
2531

2632
create(context) {

lib/rules/template-deprecated-inline-view-helper.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ module.exports = {
1515
deprecated:
1616
'The inline form of `view` is deprecated. Please use `Ember.Component` instead. See http://emberjs.com/deprecations/v1.x/#toc_ember-view',
1717
},
18+
originallyFrom: {
19+
name: 'ember-template-lint',
20+
rule: 'lib/rules/deprecated-inline-view-helper.js',
21+
docs: 'docs/rule/deprecated-inline-view-helper.md',
22+
tests: 'test/unit/rules/deprecated-inline-view-helper-test.js',
23+
},
1824
},
1925

2026
create(context) {

lib/rules/template-deprecated-render-helper.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ module.exports = {
1515
deprecated:
1616
'The render helper is deprecated in favor of using components. See https://emberjs.com/deprecations/v2.x/#toc_code-render-code-helper',
1717
},
18+
originallyFrom: {
19+
name: 'ember-template-lint',
20+
rule: 'lib/rules/deprecated-render-helper.js',
21+
docs: 'docs/rule/deprecated-render-helper.md',
22+
tests: 'test/unit/rules/deprecated-render-helper-test.js',
23+
},
1824
},
1925

2026
create(context) {

lib/rules/template-link-href-attributes.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ module.exports = {
1515
missingHref:
1616
'<a> elements must have an href attribute. Use <button> for clickable elements that are not links.',
1717
},
18+
originallyFrom: {
19+
name: 'ember-template-lint',
20+
rule: 'lib/rules/link-href-attributes.js',
21+
docs: 'docs/rule/link-href-attributes.md',
22+
tests: 'test/unit/rules/link-href-attributes-test.js',
23+
},
1824
},
1925

2026
create(context) {

lib/rules/template-link-rel-noopener.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ module.exports = {
1414
messages: {
1515
missingRel: 'links with target="_blank" must have rel="noopener noreferrer"',
1616
},
17+
originallyFrom: {
18+
name: 'ember-template-lint',
19+
rule: 'lib/rules/link-rel-noopener.js',
20+
docs: 'docs/rule/link-rel-noopener.md',
21+
tests: 'test/unit/rules/link-rel-noopener-test.js',
22+
},
1723
},
1824
create(context) {
1925
return {

lib/rules/template-modifier-name-case.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ module.exports = {
2121
dasherized:
2222
'Use dasherized names for modifier invocation. Please replace `{{dasherizeModifierName}}` with `{{dasherizeModifierName}}`.',
2323
},
24+
originallyFrom: {
25+
name: 'ember-template-lint',
26+
rule: 'lib/rules/modifier-name-case.js',
27+
docs: 'docs/rule/modifier-name-case.md',
28+
tests: 'test/unit/rules/modifier-name-case-test.js',
29+
},
2430
},
2531

2632
create(context) {

lib/rules/template-no-abstract-roles.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ module.exports = {
3030
abstractRole:
3131
'{{role}} is an abstract role, and is not a valid value for the role attribute.',
3232
},
33+
originallyFrom: {
34+
name: 'ember-template-lint',
35+
rule: 'lib/rules/no-abstract-roles.js',
36+
docs: 'docs/rule/no-abstract-roles.md',
37+
tests: 'test/unit/rules/no-abstract-roles-test.js',
38+
},
3339
},
3440

3541
create(context) {

lib/rules/template-no-accesskey-attribute.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ module.exports = {
1515
noAccesskey:
1616
'No access key attribute allowed. Inconsistencies between keyboard shortcuts and keyboard commands used by screenreader and keyboard only users create accessibility complications.',
1717
},
18+
originallyFrom: {
19+
name: 'ember-template-lint',
20+
rule: 'lib/rules/no-accesskey-attribute.js',
21+
docs: 'docs/rule/no-accesskey-attribute.md',
22+
tests: 'test/unit/rules/no-accesskey-attribute-test.js',
23+
},
1824
},
1925

2026
create(context) {

lib/rules/template-no-action-modifiers.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ module.exports = {
1414
messages: {
1515
noActionModifier: 'Do not use action modifiers. Use on modifier with a function instead.',
1616
},
17+
originallyFrom: {
18+
name: 'ember-template-lint',
19+
rule: 'lib/rules/no-action-modifiers.js',
20+
docs: 'docs/rule/no-action-modifiers.md',
21+
tests: 'test/unit/rules/no-action-modifiers-test.js',
22+
},
1723
},
1824

1925
create(context) {

0 commit comments

Comments
 (0)