Skip to content

Commit 4be7de2

Browse files
committed
Lint fixes
1 parent f919af1 commit 4be7de2

File tree

24 files changed

+123
-88
lines changed

24 files changed

+123
-88
lines changed

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"build": "ember build --environment=production",
2020
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
2121
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
22+
"lint:hbs": "ember-template-lint .",
2223
"lint:hbs:fix": "ember-template-lint . --fix",
2324
"lint:js": "eslint . --cache",
2425
"release": "release-it",
@@ -68,10 +69,11 @@
6869
"ember-page-title": "^8.0.0",
6970
"ember-qunit": "^5.1.5",
7071
"ember-resolver": "^11.0.1",
72+
"ember-set-helper": "^2.0.1",
7173
"ember-simulant-test-helpers": "^0.3.2",
7274
"ember-source": "~3.28.8",
7375
"ember-source-channel-url": "^3.0.0",
74-
"ember-template-lint": "^5.11.2",
76+
"ember-template-lint": "^5.13.0",
7577
"ember-try": "^3.0.0",
7678
"eslint": "^7.32.0",
7779
"eslint-config-prettier": "^9.0.0",

tests/dummy/app/components/clickable-pane/template.hbs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<div class="ClickablePane" onclick={{action (mut this.clicked) true}}>
1+
{{!-- template-lint-disable no-invalid-interactive --}}
2+
<div class="ClickablePane" onclick={{set this 'clicked' true}}>
23
{{#if this.clicked}}
34
clicked
45
{{else}}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div ...attributes>
2-
<button {{action (route-action 'back')}} class="y-button left-button theme-color back-button">Close</button>
3+
<button class="y-button left-button theme-color back-button" type="button" {{on 'click' (route-action 'back')}}>Close</button>
34
</div>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<div ...attributes>
22
<h1>My Schedule</h1>
3-
<a href="#" {{action (route-action 'drillDownToScheduleItem') '2'}}>Schedule Item 2</a>
3+
{{!-- template-lint-disable no-route-action --}}
4+
<a href="#" {{on 'click' (route-action 'drillDownToScheduleItem' '2')}}>Schedule Item 2</a>
45
</div>

tests/dummy/app/components/routable-components/page/header/template.hbs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div class={{@class}}>
23

34
{{#if @model.isUnderMorePage~}}
4-
<button {{action (route-action 'back')}} class="y-button left-button theme-color back-button">Back</button>
5+
<button class="y-button left-button theme-color back-button" type="button" {{on 'click' (route-action 'back')}}>Back</button>
56
{{/if~}}
67

78
{{#if @model.hasMySchedule}}
8-
<button {{action (route-action 'visitMySchedule')}} class="y-button right-button theme-color icon-button my-schedule-button js-myScheduleButton"></button>
9+
<button class="y-button right-button theme-color icon-button my-schedule-button js-myScheduleButton" type="button" {{on 'click' (route-action 'visitMySchedule')}}></button>
910
{{/if~}}
1011

1112
<div class="page-title">{{@model.pageTitle}}</div>

tests/dummy/app/components/routable-components/schedule-item/header/template.hbs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div class={{@class}}>
2-
<button {{action (route-action 'back')}} class="y-button left-button theme-color back-button">Back</button>
3+
<button class="y-button left-button theme-color back-button" type="button" {{on 'click' (route-action 'back')}}>Back</button>
34

45
{{#if @model.yapp.myScheduleEnabled}}
5-
<button {{action (route-action 'visitMySchedule')}} class="y-button right-button theme-color icon-button my-schedule-button"></button>
6+
<button class="y-button right-button theme-color icon-button my-schedule-button" type="button" {{on 'click' (route-action 'visitMySchedule')}}></button>
67
{{/if}}
78

89
<div class="page-title">Schedule Item</div>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div class={{@class}}>
2-
<button {{action (route-action 'back')}} class="y-button left-button theme-color back-button">Close</button>
3+
<button class="y-button left-button theme-color back-button" type="button" {{on 'click' (route-action 'back')}}>Close</button>
34
</div>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div class={{@class}}>
2-
<button {{action (route-action 'back')}} class="y-button left-button theme-color back-button">Back</button>
3+
<button class="y-button left-button theme-color back-button" type="button" {{on 'click' (route-action 'back')}}>Back</button>
34
<div class="page-title">Feedback</div>
45
</div>

tests/dummy/app/components/routable-components/schedule-item/template.hbs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
{{!-- template-lint-disable no-route-action no-inline-styles require-input-label --}}
12
<div ...attributes>
23
<div class='y-page-content' style="position:absolute;top:0;bottom:0;left:0;right:0">
34
<h1>schedule-item {{@model.slug}}</h1>
4-
<button {{action (route-action 'drillDownToRatingForm')}}>Rate</button>
5-
<button {{action (route-action 'logThenGoToRating')}}>Log Then Rate</button>
6-
<button {{action (route-action 'showAttachedPerson')}}>John Doe</button>
5+
<button type="button" {{on 'click' (route-action 'drillDownToRatingForm')}}>Rate</button>
6+
<button type="button" {{on 'click' (route-action 'logThenGoToRating')}}>Log Then Rate</button>
7+
<button type="button" {{on 'click' (route-action 'showAttachedPerson')}}>John Doe</button>
78
<textarea rows="8" cols="40" style="border-style: inset;"></textarea>
89
<VerticalPanDetectorPane>
910
<ClickablePane />
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div class={{@class}}>
23
<div class="page-title">{{@model.pageTitle}}</div>
34

4-
<button {{action (route-action 'back')}} class="y-button left-button theme-color back-button">Back</button>
5+
<button class="y-button left-button theme-color back-button" type="button" {{on 'click' (route-action 'back')}}>Back</button>
56

67
{{#if @model.hasMySchedule}}
7-
<button {{action (route-action 'visitMySchedule')}} class="y-button right-button theme-color icon-button my-schedule-button js-myScheduleButton"></button>
8+
<button class="y-button right-button theme-color icon-button my-schedule-button js-myScheduleButton" type="button" {{on 'click' (route-action 'visitMySchedule')}}></button>
89
{{/if~}}
910
</div>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div ...attributes>
23
<h1>track {{@model.id}}</h1>
3-
<a href="#" {{action (route-action 'drillDownToScheduleItem') '2'}}>Schedule Item 2</a>
4+
<a href="#" {{on 'click' (route-action 'drillDownToScheduleItem' '2')}}>Schedule Item 2</a>
45
</div>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div class={{@class}}>
2-
<button {{action (route-action 'back')}} class="y-button left-button theme-color back-button">Close</button>
3+
<button class="y-button left-button theme-color back-button" type="button" {{on 'click' (route-action 'back')}}>Close</button>
34
</div>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div ...attributes>
23
<h1>My Schedule</h1>
3-
<a href="#" {{action (route-action 'drillDownToScheduleItem') '2'}}>Schedule Item 2</a>
4+
<a href="#" {{on 'click' (route-action 'drillDownToScheduleItem' '2')}}>Schedule Item 2</a>
45
</div>

tests/dummy/app/components/test-components/page/header/template.hbs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div class={{@class}}>
23
{{#if @model.isUnderMorePage~}}
3-
<button {{action (route-action 'back')}} class="y-button left-button theme-color back-button">Back</button>
4+
<button class="y-button left-button theme-color back-button" type="button" {{on 'click' (route-action 'back')}}>Back</button>
45
{{/if~}}
56

67
{{#if @model.hasMySchedule}}
7-
<button {{action (route-action 'visitMySchedule')}} class="y-button right-button theme-color icon-button my-schedule-button js-myScheduleButton"></button>
8+
<button class="y-button right-button theme-color icon-button my-schedule-button js-myScheduleButton" type="button" {{on 'click' (route-action 'visitMySchedule')}}></button>
89
{{/if~}}
910

1011
<div class="page-title">{{@model.pageTitle}}</div>
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
{{!-- template-lint-disable no-inline-styles no-route-action --}}
12
<div ...attributes>
23
<div class='y-page-content' style="position:absolute;top:0;bottom:0;left:0;right:0" data-test-route-name={{@controller.routeName}}>
34
<h1>page {{@model.id}}</h1>
45
{{#if (eq @model.slug 'schedule2') }}
5-
<a href="#" {{action 'drillDownToScheduleItem' '1'}}>Schedule Item 1</a>
6+
<a href="#" {{on 'click' (route-action 'drillDownToScheduleItem' '1')}}>Schedule Item 1</a>
67
{{else if (eq @model.slug 'multi_track') }}
7-
<a href="#" {{action 'drillDownToTrack' '1'}}>Track 1</a>
8+
<a href="#" {{on 'click' (route-action 'drillDownToTrack' '1')}}>Track 1</a>
89
{{/if}}
910
</div>
1011
</div>

tests/dummy/app/components/test-components/schedule-item/header/template.hbs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div class={{@class}}>
2-
<button {{action @back}} class="y-button left-button theme-color back-button">Back</button>
3+
<button class="y-button left-button theme-color back-button" type="button" {{on 'click' @back}}>Back</button>
34

45
{{#if @model.yapp.myScheduleEnabled}}
5-
<button {{action (route-action 'visitMySchedule')}} class="y-button right-button theme-color icon-button my-schedule-button"></button>
6+
<button class="y-button right-button theme-color icon-button my-schedule-button" type="button" {{on 'click' (route-action 'visitMySchedule')}}></button>
67
{{/if}}
78

89
<div class="page-title">Schedule Item</div>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div class={{@class}}>
2-
<button {{action (route-action 'back')}} class="y-button left-button theme-color back-button">Close</button>
3+
<button class="y-button left-button theme-color back-button" type="button" {{on 'click' (route-action 'back')}}>Close</button>
34
</div>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div class={{@class}}>
2-
<button {{action (route-action 'back')}} class="y-button left-button theme-color back-button">Back</button>
3+
<button class="y-button left-button theme-color back-button" type="button" {{on 'click' (route-action 'back')}}>Back</button>
34
<div class="page-title">Feedback</div>
45
</div>

tests/dummy/app/components/test-components/schedule-item/template.hbs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
{{!-- template-lint-disable no-inline-styles require-input-label no-route-action --}}
12
<div ...attributes>
23
<div class='y-page-content' style="position:absolute;top:0;bottom:0;left:0;right:0">
34
<h1>schedule-item {{@model.slug}}</h1>
4-
<button {{action 'drillDownToRatingForm'}}>Rate</button>
5-
<button {{action 'logThenGoToRating'}}>Log Then Rate</button>
6-
<button {{action 'showAttachedPerson'}}>John Doe</button>
5+
<button type="button" {{on 'click' (route-action 'drillDownToRatingForm')}}>Rate</button>
6+
<button type="button" {{on 'click' (route-action 'logThenGoToRating')}}>Log Then Rate</button>
7+
<button type="button" {{on 'click' (route-action 'showAttachedPerson')}}>John Doe</button>
78
<textarea rows="8" cols="40" style="border-style: inset;"></textarea>
89
<VerticalPanDetectorPane>
910
<ClickablePane />

tests/dummy/app/components/test-components/track/header/template.hbs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div class={{@class}}>
2-
<button {{action (route-action 'back')}} class="y-button left-button theme-color back-button">Back</button>
3+
<button class="y-button left-button theme-color back-button" type="button" {{on 'click' (route-action 'back')}}>Back</button>
34

45
{{#if @model.hasMySchedule}}
5-
<button {{action (route-action 'visitMySchedule')}} class="y-button right-button theme-color icon-button my-schedule-button js-myScheduleButton"></button>
6+
<button class="y-button right-button theme-color icon-button my-schedule-button js-myScheduleButton" type="button" {{on 'click' (route-action 'visitMySchedule')}}></button>
67
{{/if~}}
78

89
<div class="page-title">{{@model.pageTitle}}</div>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
{{!-- template-lint-disable no-route-action --}}
12
<div ...attributes>
23
<h1>track {{@model.id}}</h1>
3-
<a href="#" {{action 'drillDownToScheduleItem' '2'}}>Schedule Item 2</a>
4+
<a href="#" {{on 'click' (route-action 'drillDownToScheduleItem' '2')}}>Schedule Item 2</a>
45
</div>

tests/dummy/app/templates/yapp.hbs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<div id='yapp-application' class={{if this.birdsEyeDebugging 'birds-eye-debugging' ''}}>
22
{{#each (nav-layer-indices) as |layerIndex|}}
3+
{{!-- template-lint-disable no-route-action --}}
34
<NavStack
45
@layer={{layerIndex}}
56
@footer={{if (eq layerIndex 0) (component 'tab-bar')}}

tests/integration/nav-stack-test.js

+56-51
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module('Integration | Component | nav-stack', function (hooks) {
3232
module('top level page', function () {
3333
let exampleHbs = hbs`
3434
{{#if this.shouldRenderNavStack}}
35+
{{!-- template-lint-disable no-inline-styles --}}
3536
<div style="width:320px;height:480px;position:relative">
3637
<NavStack
3738
@layer={{0}}
@@ -40,11 +41,11 @@ module('Integration | Component | nav-stack', function (hooks) {
4041
/>
4142
</div>
4243
{{/if}}
43-
{{to-nav-stack
44-
layer=0
45-
item=(component 'test-components/page' model=this.pageModel controller=this.controller)
46-
header=(component 'test-components/page/header' model=this.pageModel controller=this.controller)
47-
}}
44+
<ToNavStack
45+
@layer={{0}}
46+
@item={{component 'test-components/page' model=this.pageModel controller=this.controller}}
47+
@header={{component 'test-components/page/header' model=this.pageModel controller=this.controller}}
48+
/>
4849
`;
4950
test('it renders', async function (assert) {
5051
await this.renderNavStack(exampleHbs);
@@ -58,19 +59,20 @@ module('Integration | Component | nav-stack', function (hooks) {
5859
module('more page', function () {
5960
let exampleHbs = hbs`
6061
{{#if this.shouldRenderNavStack}}
62+
{{!-- template-lint-disable no-inline-styles --}}
6163
<div style="width:320px;height:480px;position:relative">
6264
<NavStack
63-
@layer={{0}}
64-
@footer={{component 'tab-bar'}}
65-
@back={{this.back}}
65+
@layer={{0}}
66+
@footer={{component 'tab-bar'}}
67+
@back={{this.back}}
6668
/>
6769
</div>
6870
{{/if}}
69-
{{to-nav-stack
70-
layer=0
71-
item=(component 'test-components/yapp/more' model=this.moreModel controller=this.controller)
72-
header=(component 'test-components/yapp/more/header' model=this.moreModel controller=this.controller)
73-
}}
71+
<ToNavStack
72+
@layer={{0}}
73+
@item={{component 'test-components/yapp/more' model=this.moreModel controller=this.controller}}
74+
@header={{component 'test-components/yapp/more/header' model=this.moreModel controller=this.controller}}
75+
/>
7476
`;
7577
test('it renders', async function (assert) {
7678
await this.renderNavStack(exampleHbs);
@@ -84,6 +86,7 @@ module('Integration | Component | nav-stack', function (hooks) {
8486
module('drilled down one level', function () {
8587
let exampleHbs = hbs`
8688
{{#if this.shouldRenderNavStack}}
89+
{{!-- template-lint-disable no-inline-styles --}}
8790
<div style="width:320px;height:480px;position:relative">
8891
<NavStack
8992
@layer={{0}}
@@ -92,16 +95,16 @@ module('Integration | Component | nav-stack', function (hooks) {
9295
/>
9396
</div>
9497
{{/if}}
95-
{{to-nav-stack
96-
layer=0
97-
item=(component 'test-components/page' model=this.pageModel controller=this.controller)
98-
header=(component 'test-components/page/header' model=this.pageModel controller=this.controller)
99-
}}
100-
{{to-nav-stack
101-
layer=0
102-
item=(component 'test-components/track' model=this.trackModel controller=this.controller)
103-
header=(component 'test-components/track/header' model=this.trackModel controller=this.controller)
104-
}}
98+
<ToNavStack
99+
@layer={{0}}
100+
@item={{component 'test-components/page' model=this.pageModel controller=this.controller}}
101+
@header={{component 'test-components/page/header' model=this.pageModel controller=this.controller}}
102+
/>
103+
<ToNavStack
104+
@layer={{0}}
105+
@item={{component 'test-components/track' model=this.trackModel controller=this.controller}}
106+
@header={{component 'test-components/track/header' model=this.trackModel controller=this.controller}}
107+
/>
105108
`;
106109
test('it renders', async function (assert) {
107110
await this.renderNavStack(exampleHbs);
@@ -115,30 +118,31 @@ module('Integration | Component | nav-stack', function (hooks) {
115118
module('drilled down two levels', function (hooks) {
116119
let exampleHbs = hbs`
117120
{{#if this.shouldRenderNavStack}}
121+
{{!-- template-lint-disable no-inline-styles --}}
118122
<div style="width:320px;height:480px;position:relative">
119123
<NavStack
120-
@layer={{0}}
121-
@footer={{component 'tab-bar'}}
122-
@back={{this.back}}
124+
@layer={{0}}
125+
@footer={{component 'tab-bar'}}
126+
@back={{this.back}}
123127
/>
124128
</div>
125129
{{/if}}
126-
{{to-nav-stack
127-
layer=0
128-
item=(component 'test-components/page' model=this.pageModel controller=this.controller)
129-
header=(component 'test-components/page/header' model=this.pageModel controller=this.controller)
130-
}}
131-
{{to-nav-stack
132-
layer=0
133-
item=(component 'test-components/track' model=this.trackModel controller=this.controller)
134-
header=(component 'test-components/track/header' model=this.trackModel controller=this.controller)
135-
}}
130+
<ToNavStack
131+
@layer={{0}}
132+
@item={{component 'test-components/page' model=this.pageModel controller=this.controller}}
133+
@header={{component 'test-components/page/header' model=this.pageModel controller=this.controller}}
134+
/>
135+
<ToNavStack
136+
@layer={{0}}
137+
@item={{component 'test-components/track' model=this.trackModel controller=this.controller}}
138+
@header={{component 'test-components/track/header' model=this.trackModel controller=this.controller}}
139+
/>
136140
{{#if this.isThirdLevelShowing}}
137-
{{to-nav-stack
138-
layer=0
139-
item=(component 'test-components/schedule-item' model=this.scheduleItemModel controller=this.controller)
140-
header=(component 'test-components/schedule-item/header' model=this.scheduleItemModel controller=this.controller back=this.back)
141-
}}
141+
<ToNavStack
142+
@layer={{0}}
143+
@item={{component 'test-components/schedule-item' model=this.scheduleItemModel controller=this.controller}}
144+
@header={{component 'test-components/schedule-item/header' model=this.scheduleItemModel controller=this.controller back=this.back}}
145+
/>
142146
{{/if}}
143147
`;
144148
hooks.beforeEach(function () {
@@ -335,6 +339,7 @@ module('Integration | Component | nav-stack', function (hooks) {
335339
module('page under more', function () {
336340
let exampleHbs = hbs`
337341
{{#if this.shouldRenderNavStack}}
342+
{{!-- template-lint-disable no-inline-styles --}}
338343
<div style="width:320px;height:480px;position:relative">
339344
<NavStack
340345
@layer={{0}}
@@ -343,16 +348,16 @@ module('Integration | Component | nav-stack', function (hooks) {
343348
/>
344349
</div>
345350
{{/if}}
346-
{{to-nav-stack
347-
layer=0
348-
item=(component 'test-components/yapp/more' model=this.moreModel controller=this.controller)
349-
header=(component 'test-components/yapp/more/header' model=this.moreModel controller=this.controller)
350-
}}
351-
{{to-nav-stack
352-
layer=0
353-
item=(component 'test-components/page' model=this.pageModel controller=this.controller)
354-
header=(component 'test-components/page/header' model=this.pageModel controller=this.controller)
355-
}}
351+
<ToNavStack
352+
@layer={{0}}
353+
@item={{component 'test-components/yapp/more' model=this.moreModel controller=this.controller}}
354+
@header={{component 'test-components/yapp/more/header' model=this.moreModel controller=this.controller}}
355+
/>
356+
<ToNavStack
357+
@layer={{0}}
358+
@item={{component 'test-components/page' model=this.pageModel controller=this.controller}}
359+
@header={{component 'test-components/page/header' model=this.pageModel controller=this.controller}}
360+
/>
356361
`;
357362
test('it renders', async function (assert) {
358363
await this.renderNavStack(exampleHbs);

0 commit comments

Comments
 (0)