Skip to content

Commit f010099

Browse files
authored
Merge pull request #1285 from adopted-ember-addons/chore/remove-no-implicit-this
chore: remove no-implicit-this lint errors
2 parents e0f875b + 1328c7c commit f010099

Some content is hidden

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

58 files changed

+516
-531
lines changed

addon/components/paper-button.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
{{! template-lint-disable no-curly-component-invocation no-implicit-this }}
1+
{{! template-lint-disable no-curly-component-invocation }}
22
{{#if (has-block)}}
33
{{yield}}
44
{{else}}
5-
{{label}}
5+
{{@label}}
66
{{/if}}
77

88
<PaperRipple
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
{{! template-lint-disable no-implicit-this }}
21
{{#if (has-block)}}
3-
<div class="md-media-{{size}}">
2+
<div class="md-media-{{this.size}}">
43
{{yield}}
54
</div>
65
{{else}}
7-
<img class="md-media-{{size}}" src={{src}} alt={{alt}} title={{title}}>
6+
<img class="md-media-{{this.size}}" src={{@src}} alt={{@alt}} title={{@title}}>
87
{{/if}}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
{{! template-lint-disable no-implicit-this }}
21
{{#if (has-block)}}
3-
<div class="md-media-{{size}}">
2+
<div class="md-media-{{this.size}}">
43
{{yield}}
54
</div>
65
{{else}}
7-
<img class="md-media-{{size}}" src={{src}} alt={{alt}} title={{title}}>
6+
<img class="md-media-{{this.size}}" src={{@src}} alt={{@alt}} title={{@title}}>
87
{{/if}}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{! template-lint-disable no-curly-component-invocation no-implicit-this }}
1+
{{! template-lint-disable no-curly-component-invocation }}
22
<div class="md-container">
33
<div class="md-icon"></div>
44
<PaperRipple
@@ -7,14 +7,14 @@
77
</div>
88
{{#if (has-block)}}
99
<div class="md-label">
10-
<span id={{labelId}}>
10+
<span id={{this.labelId}}>
1111
{{yield}}
1212
</span>
1313
</div>
1414
{{else}}
1515
<div class="md-label">
16-
<span id={{labelId}}>
17-
{{label}}
16+
<span id={{this.labelId}}>
17+
{{@label}}
1818
</span>
1919
</div>
2020
{{/if}}

addon/components/paper-contact-chips/template.hbs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{{! template-lint-disable no-implicit-this }}
21
<md-contact-chips class="md-default-theme {{@class}}" ...attributes>
32
<PaperChips
43
class="md-contact-chips"
@@ -25,9 +24,9 @@
2524

2625
{{#if (eq type "chip")}}
2726
<div class="md-contact-avatar">
28-
<img src={{get item imageField}} alt={{get item nameField}}>
27+
<img src={{get item this.imageField}} alt={{get item this.nameField}}>
2928
</div>
30-
<span class="md-contact-name">{{get item nameField}}</span>
29+
<span class="md-contact-name">{{get item this.nameField}}</span>
3130
{{/if}}
3231

3332
</PaperChips>

addon/components/paper-dialog.hbs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
{{! template-lint-disable no-action no-implicit-this }}
2-
{{#in-element destinationEl insertBefore=null}}
3-
<PaperBackdrop @locked-open={{isLockedOpen}} @opaque={{opaque}} @fixed={{unless parent true}} @class="md-dialog-backdrop" @onClick={{action "outsideClicked"}} />
4-
<PaperDialogContainer @class={{readonly dialogContainerClass}} @outsideClicked={{action "outsideClicked"}}>
5-
<PaperDialogInner @class={{readonly class}} @origin={{origin}} @defaultedParent={{defaultedParent}} @defaultedOpenFrom={{defaultedOpenFrom}} @defaultedCloseTo={{defaultedCloseTo}} @fullscreen={{fullscreen}} @focusOnOpen={{focusOnOpen}}>
1+
{{! template-lint-disable no-action }}
2+
{{#in-element this.destinationEl insertBefore=null}}
3+
<PaperBackdrop @locked-open={{@isLockedOpen}} @opaque={{this.opaque}} @fixed={{unless @parent true}} @class="md-dialog-backdrop" @onClick={{action "outsideClicked"}} />
4+
<PaperDialogContainer @class={{readonly @dialogContainerClass}} @outsideClicked={{action "outsideClicked"}}>
5+
<PaperDialogInner @class={{readonly @class}} @origin={{@origin}} @defaultedParent={{this.defaultedParent}} @defaultedOpenFrom={{this.defaultedOpenFrom}} @defaultedCloseTo={{this.defaultedCloseTo}} @fullscreen={{@fullscreen}} @focusOnOpen={{this.focusOnOpen}}>
66
{{yield}}
77
</PaperDialogInner>
88
</PaperDialogContainer>

addon/components/paper-form.hbs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
{{! template-lint-disable no-action no-implicit-this }}
1+
{{! template-lint-disable no-action }}
22
{{yield (hash
3-
isValid=isValid
4-
isInvalid=isInvalid
5-
isTouched=isTouched
6-
isInvalidAndTouched=isInvalidAndTouched
7-
input=(component inputComponent
3+
isValid=this.isValid
4+
isInvalid=this.isInvalid
5+
isTouched=this.isTouched
6+
isInvalidAndTouched=this.isInvalidAndTouched
7+
input=(component this.inputComponent
88
parentComponent=this
99
onValidityChange=(action "localOnValidityChange")
1010
)
11-
submit-button=(component submitButtonComponent
11+
submit-button=(component this.submitButtonComponent
1212
type="submit"
1313
)
14-
select=(component selectComponent
14+
select=(component this.selectComponent
1515
parentComponent=this
1616
onValidityChange=(action "localOnValidityChange")
1717
)
18-
autocomplete=(component autocompleteComponent
18+
autocomplete=(component this.autocompleteComponent
1919
parentComponent=this
2020
onValidityChange=(action "localOnValidityChange")
2121
)

addon/components/paper-icon.hbs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
{{! template-lint-disable no-implicit-this }}
2-
{{-paper-underscore iconClass}}
1+
{{-paper-underscore this.iconClass}}
32
{{yield}}

addon/components/paper-input.hbs

Lines changed: 85 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,97 @@
1-
{{! template-lint-disable no-action no-curly-component-invocation no-down-event-binding no-implicit-this no-positive-tabindex }}
2-
{{#if label}}
3-
<label for={{inputElementId}} class={{if required "md-required"}}>{{label}}</label>
1+
{{! template-lint-disable no-action no-curly-component-invocation no-down-event-binding no-positive-tabindex }}
2+
{{#if @label}}
3+
<label for={{this.inputElementId}} class={{if @required "md-required"}}>{{@label}}</label>
44
{{/if}}
55

6-
{{#if icon}}
7-
{{component iconComponent icon}}
6+
{{#if @icon}}
7+
{{component this.iconComponent @icon}}
88
{{/if}}
99

10-
{{#if textarea}}
10+
{{#if @textarea}}
1111
<textarea
12-
class="md-input {{if isInvalid "ng-invalid"}} {{if isTouched "ng-dirty"}}"
13-
id={{inputElementId}}
14-
placeholder={{if shouldAddPlaceholder placeholder}}
15-
disabled={{disabled}}
16-
autofocus={{autofocus}}
17-
aria-describedby={{concat elementId "-char-count " elementId "-error-messages"}}
18-
onfocus={{onFocus}}
12+
class="md-input {{if this.isInvalid "ng-invalid"}} {{if this.isTouched "ng-dirty"}}"
13+
id={{this.inputElementId}}
14+
placeholder={{if this.shouldAddPlaceholder @placeholder}}
15+
disabled={{this.disabled}}
16+
autofocus={{this.autofocus}}
17+
aria-describedby={{concat this.elementId "-char-count " this.elementId "-error-messages"}}
18+
onfocus={{@onFocus}}
1919
onblur={{action "handleBlur"}}
20-
onkeydown={{onKeyDown}}
21-
onkeyup={{onKeyUp}}
22-
onclick={{onClick}}
20+
onkeydown={{@onKeyDown}}
21+
onkeyup={{@onKeyUp}}
22+
onclick={{@onClick}}
2323
oninput={{action "handleInput"}}
2424

25-
name={{passThru.name}}
26-
rows={{passThru.rows}}
27-
cols={{passThru.cols}}
28-
maxlength={{passThru.maxlength}}
29-
tabindex={{passThru.tabindex}}
30-
title={{title}}
31-
required={{passThru.required}}
32-
selectionEnd={{passThru.selectionEnd}}
33-
selectionStart={{passThru.selectionStart}}
34-
selectionDirection={{passThru.selectionDirection}}
35-
wrap={{passThru.wrap}}
36-
readonly={{passThru.readonly}}
37-
form={{passThru.form}}
38-
spellcheck={{passThru.spellcheck}}></textarea>
25+
name={{@passThru.name}}
26+
rows={{@passThru.rows}}
27+
cols={{@passThru.cols}}
28+
maxlength={{@passThru.maxlength}}
29+
tabindex={{@passThru.tabindex}}
30+
title={{@title}}
31+
required={{@passThru.required}}
32+
selectionEnd={{@passThru.selectionEnd}}
33+
selectionStart={{@passThru.selectionStart}}
34+
selectionDirection={{@passThru.selectionDirection}}
35+
wrap={{@passThru.wrap}}
36+
readonly={{@passThru.readonly}}
37+
form={{@passThru.form}}
38+
spellcheck={{@passThru.spellcheck}}></textarea>
3939
{{else}}
4040
<input
41-
class="md-input {{if isInvalid "ng-invalid"}} {{if isTouched "ng-dirty"}}"
42-
id={{inputElementId}}
43-
placeholder={{if shouldAddPlaceholder placeholder}}
44-
type={{type}}
45-
disabled={{disabled}}
46-
autofocus={{autofocus}}
47-
aria-describedby={{concat elementId "-char-count " elementId "-error-messages"}}
48-
onfocus={{onFocus}}
41+
class="md-input {{if this.isInvalid "ng-invalid"}} {{if this.isTouched "ng-dirty"}}"
42+
id={{this.inputElementId}}
43+
placeholder={{if this.shouldAddPlaceholder @placeholder}}
44+
type={{this.type}}
45+
disabled={{this.disabled}}
46+
autofocus={{this.autofocus}}
47+
aria-describedby={{concat this.elementId "-char-count " this.elementId "-error-messages"}}
48+
onfocus={{@onFocus}}
4949
onblur={{action "handleBlur"}}
50-
onkeydown={{onKeyDown}}
51-
onkeyup={{onKeyUp}}
52-
onclick={{onClick}}
50+
onkeydown={{@onKeyDown}}
51+
onkeyup={{@onKeyUp}}
52+
onclick={{@onClick}}
5353
oninput={{action "handleInput"}}
5454

55-
accept={{passThru.accept}}
56-
autocomplete={{passThru.autocomplete}}
57-
autocorrect={{passThru.autocorrect}}
58-
autocapitalize={{passThru.autocapitalize}}
59-
autosave={{passThru.autosave}}
60-
form={{passThru.form}}
61-
formaction={{passThru.formaction}}
62-
formenctype={{passThru.formenctype}}
63-
formmethod={{passThru.formmethod}}
64-
formnovalidate={{passThru.formnovalidate}}
65-
formtarget={{passThru.formtarget}}
66-
height={{passThru.height}}
67-
inputmode={{passThru.inputmode}}
68-
min={{passThru.min}}
69-
maxlength={{passThru.maxlength}}
70-
max={{passThru.max}}
71-
multiple={{passThru.multiple}}
72-
name={{passThru.name}}
73-
pattern={{passThru.pattern}}
74-
readonly={{passThru.readonly}}
75-
required={{passThru.required}}
76-
selectionDirection={{passThru.selectionDirection}}
77-
size={{passThru.size}}
78-
spellcheck={{passThru.spellcheck}}
79-
step={{passThru.step}}
80-
tabindex={{passThru.tabindex}}
81-
title={{title}}
82-
width={{passThru.width}}>
55+
accept={{@passThru.accept}}
56+
autocomplete={{@passThru.autocomplete}}
57+
autocorrect={{@passThru.autocorrect}}
58+
autocapitalize={{@passThru.autocapitalize}}
59+
autosave={{@passThru.autosave}}
60+
form={{@passThru.form}}
61+
formaction={{@passThru.formaction}}
62+
formenctype={{@passThru.formenctype}}
63+
formmethod={{@passThru.formmethod}}
64+
formnovalidate={{@passThru.formnovalidate}}
65+
formtarget={{@passThru.formtarget}}
66+
height={{@passThru.height}}
67+
inputmode={{@passThru.inputmode}}
68+
min={{@passThru.min}}
69+
maxlength={{@passThru.maxlength}}
70+
max={{@passThru.max}}
71+
multiple={{@passThru.multiple}}
72+
name={{@passThru.name}}
73+
pattern={{@passThru.pattern}}
74+
readonly={{@passThru.readonly}}
75+
required={{@passThru.required}}
76+
selectionDirection={{@passThru.selectionDirection}}
77+
size={{@passThru.size}}
78+
spellcheck={{@passThru.spellcheck}}
79+
step={{@passThru.step}}
80+
tabindex={{@passThru.tabindex}}
81+
title={{@title}}
82+
width={{@passThru.width}}>
8383
{{/if}}
8484

85-
{{#unless hideAllMessages}}
86-
<div class="md-errors-spacer" id={{concat elementId "-char-count"}}>
87-
{{#if maxlength}}
88-
<div class="md-char-counter">{{renderCharCount}}</div>
85+
{{#unless this.hideAllMessages}}
86+
<div class="md-errors-spacer" id={{concat this.elementId "-char-count"}}>
87+
{{#if @maxlength}}
88+
<div class="md-char-counter">{{this.currentLength}}/{{@maxlength}}</div>
8989
{{/if}}
9090
</div>
91-
{{#if isInvalidAndTouched}}
92-
<div class="md-input-messages-animation md-auto-hide" id={{concat elementId "-error-messages"}}>
93-
{{#each validationErrorMessages as |error index|}}
94-
<div id="error-{{inputElementId}}-{{index}}"
91+
{{#if this.isInvalidAndTouched}}
92+
<div class="md-input-messages-animation md-auto-hide" id={{concat this.elementId "-error-messages"}}>
93+
{{#each this.validationErrorMessages as |error index|}}
94+
<div id="error-{{this.inputElementId}}-{{index}}"
9595
class="paper-input-error ng-enter ng-enter-active md-input-message-animation"
9696
style="opacity: 1; margin-top: 0">
9797
{{error.message}}
@@ -102,14 +102,14 @@
102102
{{/unless}}
103103

104104
{{yield (hash
105-
charCount=currentLength
106-
isInvalid=isInvalid
107-
isTouched=isTouched
108-
isInvalidAndTouched=isInvalidAndTouched
109-
hasValue=hasValue
110-
validationErrorMessages=validationErrorMessages
105+
charCount=this.currentLength
106+
isInvalid=this.isInvalid
107+
isTouched=this.isTouched
108+
isInvalidAndTouched=this.isInvalidAndTouched
109+
hasValue=this.hasValue
110+
validationErrorMessages=this.validationErrorMessages
111111
)}}
112112

113-
{{#if iconRight}}
114-
{{component iconComponent iconRight}}
113+
{{#if @iconRight}}
114+
{{component this.iconComponent @iconRight}}
115115
{{/if}}

addon/components/paper-input.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ export default Component.extend(
7676
},
7777
}),
7878

79-
renderCharCount: computed('value', function () {
80-
let currentLength = this.value ? this.value.length : 0;
81-
return `${currentLength}/${this.maxlength}`;
79+
currentLength: computed('value', function () {
80+
return this.value ? this.value.length : 0;
8281
}),
8382

8483
hasLeftIcon: bool('icon'),

0 commit comments

Comments
 (0)