Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lint tools #2576

Merged
merged 3 commits into from Jan 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc-hound.json
Expand Up @@ -8,7 +8,8 @@
},
"settings": {
"react": {
"pragma": "h"
"pragma": "h",
"version": "15.0"
},
"import/resolver": {
"webpack": {
Expand Down
38 changes: 18 additions & 20 deletions demo/src/custom-cards/ha-demo-card.ts
Expand Up @@ -54,26 +54,24 @@ export class HADemoCard extends LitElement implements LovelaceCard {
.disabled=${this._switching}
></paper-icon-button>
<div>
${
this._switching
? html`
<paper-spinner-lite active></paper-spinner-lite>
`
: until(
selectedDemoConfig.then(
(conf) => html`
${conf.name}
<small>
by
<a target="_blank" href="${conf.authorUrl}">
${conf.authorName}
</a>
</small>
`
),
""
)
}
${this._switching
? html`
<paper-spinner-lite active></paper-spinner-lite>
`
: until(
selectedDemoConfig.then(
(conf) => html`
${conf.name}
<small>
by
<a target="_blank" href="${conf.authorUrl}">
${conf.authorName}
</a>
</small>
`
),
""
)}
</div>
<paper-icon-button
@click=${this._nextConfig}
Expand Down
32 changes: 15 additions & 17 deletions gallery/src/demos/demo-util-long-press.ts
Expand Up @@ -8,25 +8,23 @@ export class DemoUtilLongPress extends LitElement {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()}
${
[1, 2, 3].map(
() => html`
<ha-card>
<paper-button
@ha-click="${this._handleTap}"
@ha-hold="${this._handleHold}"
.longPress="${longPress()}"
>
(long) press me!
</paper-button>
${[1, 2, 3].map(
() => html`
<ha-card>
<paper-button
@ha-click="${this._handleTap}"
@ha-hold="${this._handleHold}"
.longPress="${longPress()}"
>
(long) press me!
</paper-button>

<textarea></textarea>
<textarea></textarea>

<div>(try pressing and scrolling too!)</div>
</ha-card>
`
)
}
<div>(try pressing and scrolling too!)</div>
</ha-card>
`
)}
`;
}

Expand Down
10 changes: 5 additions & 5 deletions hassio/src/hassio-pages-with-tabs.js
Expand Up @@ -62,25 +62,25 @@ class HassioPagesWithTabs extends NavigateMixin(PolymerElement) {
<paper-tab page-name="system">System</paper-tab>
</paper-tabs>
</app-header>
<template is="dom-if" if="[[equals(page, &quot;dashboard&quot;)]]">
<template is="dom-if" if='[[equals(page, "dashboard")]]'>
<hassio-dashboard
hass="[[hass]]"
supervisor-info="[[supervisorInfo]]"
hass-info="[[hassInfo]]"
></hassio-dashboard>
</template>
<template is="dom-if" if="[[equals(page, &quot;snapshots&quot;)]]">
<template is="dom-if" if='[[equals(page, "snapshots")]]'>
<hassio-snapshots
hass="[[hass]]"
installed-addons="[[supervisorInfo.addons]]"
snapshot-slug="{{snapshotSlug}}"
snapshot-deleted="{{snapshotDeleted}}"
></hassio-snapshots>
</template>
<template is="dom-if" if="[[equals(page, &quot;store&quot;)]]">
<template is="dom-if" if='[[equals(page, "store")]]'>
<hassio-addon-store hass="[[hass]]"></hassio-addon-store>
</template>
<template is="dom-if" if="[[equals(page, &quot;system&quot;)]]">
<template is="dom-if" if='[[equals(page, "system")]]'>
<hassio-system
hass="[[hass]]"
supervisor-info="[[supervisorInfo]]"
Expand All @@ -94,7 +94,7 @@ class HassioPagesWithTabs extends NavigateMixin(PolymerElement) {
content="[[markdownContent]]"
></hassio-markdown-dialog>

<template is="dom-if" if="[[equals(page, &quot;snapshots&quot;)]]">
<template is="dom-if" if='[[equals(page, "snapshots")]]'>
<hassio-snapshot
hass="[[hass]]"
snapshot-slug="{{snapshotSlug}}"
Expand Down
15 changes: 3 additions & 12 deletions hassio/src/system/hassio-supervisor-info.js
Expand Up @@ -50,10 +50,7 @@ class HassioSupervisorInfo extends EventsMixin(PolymerElement) {
<td>Latest version</td>
<td>[[data.last_version]]</td>
</tr>
<template
is="dom-if"
if="[[!_equals(data.channel, &quot;stable&quot;)]]"
>
<template is="dom-if" if='[[!_equals(data.channel, "stable")]]'>
<tr>
<td>Channel</td>
<td>[[data.channel]]</td>
Expand All @@ -74,21 +71,15 @@ class HassioSupervisorInfo extends EventsMixin(PolymerElement) {
>Update</ha-call-api-button
>
</template>
<template
is="dom-if"
if="[[_equals(data.channel, &quot;beta&quot;)]]"
>
<template is="dom-if" if='[[_equals(data.channel, "beta")]]'>
<ha-call-api-button
hass="[[hass]]"
path="hassio/supervisor/options"
data="[[leaveBeta]]"
>Leave beta channel</ha-call-api-button
>
</template>
<template
is="dom-if"
if="[[_equals(data.channel, &quot;stable&quot;)]]"
>
<template is="dom-if" if='[[_equals(data.channel, "stable")]]'>
<paper-button
on-click="_joinBeta"
class="warning"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -112,7 +112,7 @@
"del": "^3.0.0",
"eslint": "^5.6.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^3.1.0",
"eslint-config-prettier": "^4.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-prettier": "^3.0.0",
"eslint-plugin-react": "^7.11.1",
Expand Down
10 changes: 5 additions & 5 deletions src/auth/ha-auth-flow.js
Expand Up @@ -21,21 +21,21 @@ class HaAuthFlow extends localizeLiteMixin(PolymerElement) {
}
</style>
<form>
<template is="dom-if" if="[[_equals(_state, &quot;loading&quot;)]]">
<template is="dom-if" if='[[_equals(_state, "loading")]]'>
[[localize('ui.panel.page-authorize.form.working')]]:
</template>
<template is="dom-if" if="[[_equals(_state, &quot;error&quot;)]]">
<template is="dom-if" if='[[_equals(_state, "error")]]'>
<div class="error">Error: [[_errorMsg]]</div>
</template>
<template is="dom-if" if="[[_equals(_state, &quot;step&quot;)]]">
<template is="dom-if" if="[[_equals(_step.type, &quot;abort&quot;)]]">
<template is="dom-if" if='[[_equals(_state, "step")]]'>
<template is="dom-if" if='[[_equals(_step.type, "abort")]]'>
[[localize('ui.panel.page-authorize.abort_intro')]]:
<ha-markdown
content="[[_computeStepAbortedReason(localize, _step)]]"
></ha-markdown>
</template>

<template is="dom-if" if="[[_equals(_step.type, &quot;form&quot;)]]">
<template is="dom-if" if='[[_equals(_step.type, "form")]]'>
<template
is="dom-if"
if="[[_computeStepDescription(localize, _step)]]"
Expand Down
34 changes: 15 additions & 19 deletions src/auth/ha-authorize.ts
Expand Up @@ -78,13 +78,11 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
return html`
${this.renderStyle()}
<p>
${
this.localize(
"ui.panel.page-authorize.authorizing_client",
"clientId",
this.clientId
)
}
${this.localize(
"ui.panel.page-authorize.authorizing_client",
"clientId",
this.clientId
)}
</p>
${loggingInWith}

Expand All @@ -97,18 +95,16 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
.step="{{step}}"
></ha-auth-flow>

${
inactiveProviders.length > 0
? html`
<ha-pick-auth-provider
.resources="${this.resources}"
.clientId="${this.clientId}"
.authProviders="${inactiveProviders}"
@pick="${this._handleAuthProviderPick}"
></ha-pick-auth-provider>
`
: ""
}
${inactiveProviders.length > 0
? html`
<ha-pick-auth-provider
.resources="${this.resources}"
.clientId="${this.clientId}"
.authProviders="${inactiveProviders}"
@pick="${this._handleAuthProviderPick}"
></ha-pick-auth-provider>
`
: ""}
`;
}

Expand Down
11 changes: 4 additions & 7 deletions src/components/entity/ha-state-label-badge.ts
Expand Up @@ -56,13 +56,10 @@ export class HaStateLabelBadge extends hassLocalizeLitMixin(LitElement) {
return html`
${this.renderStyle()}
<ha-label-badge
class="${
classMap({
[domain]: true,
"has-unit_of_measurement":
"unit_of_measurement" in state.attributes,
})
}"
class="${classMap({
[domain]: true,
"has-unit_of_measurement": "unit_of_measurement" in state.attributes,
})}"
.value="${this._computeValue(domain, state)}"
.icon="${this._computeIcon(domain, state)}"
.image="${state.attributes.entity_picture}"
Expand Down
18 changes: 7 additions & 11 deletions src/components/ha-form.js
Expand Up @@ -48,12 +48,12 @@ class HaForm extends EventsMixin(PolymerElement) {

<template
is="dom-if"
if="[[_equals(schema.type, &quot;string&quot;)]]"
if='[[_equals(schema.type, "string")]]'
restamp=""
>
<template
is="dom-if"
if="[[_includes(schema.name, &quot;password&quot;)]]"
if='[[_includes(schema.name, "password")]]'
restamp=""
>
<paper-input
Expand All @@ -77,7 +77,7 @@ class HaForm extends EventsMixin(PolymerElement) {
</template>
<template
is="dom-if"
if="[[!_includes(schema.name, &quot;password&quot;)]]"
if='[[!_includes(schema.name, "password")]]'
restamp=""
>
<paper-input
Expand All @@ -92,7 +92,7 @@ class HaForm extends EventsMixin(PolymerElement) {

<template
is="dom-if"
if="[[_equals(schema.type, &quot;integer&quot;)]]"
if='[[_equals(schema.type, "integer")]]'
restamp=""
>
<template is="dom-if" if="[[_isRange(schema)]]" restamp="">
Expand All @@ -118,11 +118,7 @@ class HaForm extends EventsMixin(PolymerElement) {
</template>
</template>

<template
is="dom-if"
if="[[_equals(schema.type, &quot;float&quot;)]]"
restamp=""
>
<template is="dom-if" if='[[_equals(schema.type, "float")]]' restamp="">
<!-- TODO -->
<paper-input
label="[[computeLabel(schema)]]"
Expand All @@ -135,7 +131,7 @@ class HaForm extends EventsMixin(PolymerElement) {

<template
is="dom-if"
if="[[_equals(schema.type, &quot;boolean&quot;)]]"
if='[[_equals(schema.type, "boolean")]]'
restamp=""
>
<div>
Expand All @@ -147,7 +143,7 @@ class HaForm extends EventsMixin(PolymerElement) {

<template
is="dom-if"
if="[[_equals(schema.type, &quot;select&quot;)]]"
if='[[_equals(schema.type, "select")]]'
restamp=""
>
<paper-dropdown-menu label="[[computeLabel(schema)]]">
Expand Down