1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-22 03:39:01 +00:00

Update typescript, prettier, tslint -> eslint (#5536)

* Update typescript, prettier, tslint -> eslint

* Organize imports

* Use glob for eslint fix react import
This commit is contained in:
Bram Kragten
2020-04-14 18:05:45 +02:00
committed by GitHub
parent b17490f0de
commit 82f80db558
737 changed files with 9408 additions and 7414 deletions

View File

@@ -1,34 +1,33 @@
import "@polymer/iron-icon/iron-icon";
import "@polymer/paper-icon-button/paper-icon-button";
import "../../components/dialog/ha-paper-dialog";
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
import type { PaperDialogScrollableElement } from "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
import "@polymer/paper-icon-button/paper-icon-button";
import "@polymer/paper-input/paper-input";
import type { PaperInputElement } from "@polymer/paper-input/paper-input";
import {
LitElement,
html,
property,
CSSResult,
css,
CSSResult,
customElement,
query,
html,
LitElement,
property,
PropertyValues,
query,
TemplateResult,
} from "lit-element";
import { HomeAssistant } from "../../types";
import { classMap } from "lit-html/directives/class-map";
import { fireEvent } from "../../common/dom/fire_event";
import { SpeechRecognition } from "../../common/dom/speech-recognition";
import {
processText,
getAgentInfo,
setConversationOnboarding,
AgentInfo,
} from "../../data/conversation";
import { classMap } from "lit-html/directives/class-map";
import { PaperInputElement } from "@polymer/paper-input/paper-input";
import { haStyleDialog } from "../../resources/styles";
// tslint:disable-next-line
import { PaperDialogScrollableElement } from "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
import { uid } from "../../common/util/uid";
import "../../components/dialog/ha-paper-dialog";
import {
AgentInfo,
getAgentInfo,
processText,
setConversationOnboarding,
} from "../../data/conversation";
import { haStyleDialog } from "../../resources/styles";
import type { HomeAssistant } from "../../types";
interface Message {
who: string;
@@ -44,17 +43,24 @@ interface Results {
@customElement("ha-voice-command-dialog")
export class HaVoiceCommandDialog extends LitElement {
@property() public hass!: HomeAssistant;
@property() public results: Results | null = null;
@property() private _conversation: Message[] = [
{
who: "hass",
text: "",
},
];
@property() private _opened = false;
@property() private _agentInfo?: AgentInfo;
@query("#messages") private messages!: PaperDialogScrollableElement;
private recognition!: SpeechRecognition;
private _conversationId?: string;
public async showDialog(): Promise<void> {
@@ -244,6 +250,7 @@ export class HaVoiceCommandDialog extends LitElement {
};
this.recognition.onerror = (event) => {
this.recognition!.abort();
// @ts-ignore
if (event.error !== "aborted") {
const text =
this.results && this.results.transcript