Skip to content

Commit 2dbcb11

Browse files
committed
Fix eslint errors
1 parent 8a152db commit 2dbcb11

File tree

6 files changed

+41
-52
lines changed

6 files changed

+41
-52
lines changed

.eslintrc.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ parserOptions:
1515
sourceType: module
1616
rules:
1717
indent: off
18-
max-len: [warn, 120]
18+
max-len: off # clang-format fixes line lengths
1919
no-new: warn
2020
quotes: [error, single, {"avoidEscape": true}]
2121
no-var: error
@@ -33,6 +33,7 @@ rules:
3333
valid-jsdoc: off
3434

3535
prefer-const: error
36+
comma-dangle: off
3637

3738
# Rules for our mocha unit tests. Note that even though we use mocha, we model our unit tests
3839
# after frameworks such as tape and ava, which encourage modern paradigms, seek to minimize

packages/checkbox/src/mwc-checkbox-base.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ export class CheckboxBase extends FormElement {
3434
})
3535
disabled = false;
3636

37-
@property({type: String})
38-
value = ''
37+
@property({type: String}) value = '';
3938

40-
protected mdcFoundationClass = MDCCheckboxFoundation;
39+
protected mdcFoundationClass = MDCCheckboxFoundation;
4140

4241
protected mdcFoundation!: MDCCheckboxFoundation;
4342

packages/fab/src/mwc-fab-base.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@ export class FabBase extends LitElement {
5151
aria-label="${this.label || this.icon}">
5252
${showLabel && this.showIconAtEnd ? this.label : ''}
5353
${
54-
this.icon ?
55-
html
56-
`<span class="material-icons mdc-fab__icon">${this.icon}</span>`: ''}
57-
${
58-
showLabel &&
59-
!this.showIconAtEnd ? this.label : ''}
54+
this.icon ? html`<span class="material-icons mdc-fab__icon">${
55+
this.icon}</span>` :
56+
''}
57+
${showLabel && !this.showIconAtEnd ? this.label : ''}
6058
</button>`;
6159
}
6260
}

packages/linear-progress/src/mwc-linear-progress-base.ts

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,18 @@ export class LinearProgressBase extends BaseElement {
2323

2424
protected readonly mdcFoundationClass = MDCLinearProgressFoundation;
2525

26-
@query('.mdc-linear-progress')
27-
protected mdcRoot!: HTMLElement
26+
@query('.mdc-linear-progress') protected mdcRoot!: HTMLElement;
2827

29-
@query('.mdc-linear-progress__primary-bar') protected primaryBar
30-
!: HTMLElement
28+
@query('.mdc-linear-progress__primary-bar')
29+
protected primaryBar!: HTMLElement;
3130

32-
@query('.mdc-linear-progress__buffer') protected bufferElement
33-
!: HTMLElement
31+
@query('.mdc-linear-progress__buffer') protected bufferElement!: HTMLElement;
3432

35-
@property({type: Boolean, reflect: true})
36-
@observer(function(this: LinearProgressBase, value: boolean) {
37-
this.mdcFoundation.setDeterminate(value);
38-
}) determinate = false;
33+
@property({type: Boolean, reflect: true})
34+
@observer(function(this: LinearProgressBase, value: boolean) {
35+
this.mdcFoundation.setDeterminate(value);
36+
})
37+
determinate = false;
3938

4039
@property({type: Number})
4140
@observer(function(this: LinearProgressBase, value: number) {
@@ -84,16 +83,15 @@ export class LinearProgressBase extends BaseElement {
8483
...addHasRemoveClass(this.mdcRoot),
8584
getPrimaryBar: () => this.primaryBar,
8685
getBuffer: () => this.bufferElement,
87-
setStyle: (el: HTMLElement, property: string, value: string) =>
88-
// TODO(aomarks) Consider moving this type to the
89-
// MDCLinearProgressAdapter parameter type, but note that the
90-
// "-webkit" prefixed CSS properties are not declared in
91-
// CSSStyleDeclaration.
92-
//
93-
// Exclude read-only properties.
94-
el.style
95-
[property as
96-
Exclude<keyof CSSStyleDeclaration, 'length'|'parentRule'>] = value,
86+
setStyle: (el: HTMLElement, property: string, value: string) => {
87+
// TODO(aomarks) Consider moving this type to the
88+
// MDCLinearProgressAdapter parameter type, but note that the "-webkit"
89+
// prefixed CSS properties are not declared in CSSStyleDeclaration.
90+
//
91+
// Exclude read-only properties.
92+
el.style[property as Exclude<keyof CSSStyleDeclaration, 'length'|'parentRule'>] =
93+
value;
94+
},
9795
};
9896
}
9997

packages/slider/src/mwc-slider-base.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,22 +97,21 @@ export class SliderBase extends FormElement {
9797
<div class="mdc-slider__track"></div>
9898
${
9999
discrete && markers ?
100-
html
101-
`<div class="mdc-slider__track-marker-container">
100+
html`<div class="mdc-slider__track-marker-container">
102101
${
103-
repeat(
104-
new Array(_numMarkers),
105-
() => html`<div class="mdc-slider__track-marker"></div>`)}
106-
</div>`: ''}
102+
repeat(
103+
new Array(_numMarkers),
104+
() => html`<div class="mdc-slider__track-marker"></div>`)}
105+
</div>` :
106+
''}
107107
</div>
108108
<div class="mdc-slider__thumb-container">
109109
<!-- TODO: use cache() directive -->
110110
${
111-
discrete ?
112-
html`<div class="mdc-slider__pin">
111+
discrete ? html`<div class="mdc-slider__pin">
113112
<span class="mdc-slider__pin-value-marker"></span>
114113
</div>` :
115-
''}
114+
''}
116115
<svg class="mdc-slider__thumb" width="21" height="21">
117116
<circle cx="10.5" cy="10.5" r="7.875"></circle>
118117
</svg>

packages/tab/src/mwc-tab-base.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,22 +98,16 @@ export class TabBase extends BaseElement {
9898
<span class="mdc-tab__content">
9999
<slot></slot>
100100
${
101-
this.icon ?
102-
html
103-
`<span class="mdc-tab__icon material-icons">${this.icon}</span>`: ''}
101+
this.icon ? html`<span class="mdc-tab__icon material-icons">${
102+
this.icon}</span>` :
103+
''}
104104
${
105105
this.label ?
106-
html
107-
`<span class="mdc-tab__text-label">${this.label}</span>`: ''}
108-
${
109-
this.isMinWidthIndicator ?
110-
this.renderIndicator() :
111-
''}
106+
html`<span class="mdc-tab__text-label">${this.label}</span>` :
107+
''}
108+
${this.isMinWidthIndicator ? this.renderIndicator() : ''}
112109
</span>
113-
${
114-
this.isMinWidthIndicator ?
115-
'' :
116-
this.renderIndicator()}
110+
${this.isMinWidthIndicator ? '' : this.renderIndicator()}
117111
<span class="mdc-tab__ripple" .ripple="${ripple({
118112
interactionNode: this,
119113
unbounded: false

0 commit comments

Comments
 (0)