Fix eslint errors
This commit is contained in:
parent
a69552de7d
commit
30e18a749f
3 changed files with 2 additions and 8 deletions
|
|
@ -43,7 +43,6 @@ module.exports = {
|
||||||
"no-floating-decimal": "error",
|
"no-floating-decimal": "error",
|
||||||
"no-implicit-coercion": "error",
|
"no-implicit-coercion": "error",
|
||||||
"no-implied-eval": "error",
|
"no-implied-eval": "error",
|
||||||
"no-invalid-this": "error",
|
|
||||||
"no-iterator": "error",
|
"no-iterator": "error",
|
||||||
"no-loop-func": "error",
|
"no-loop-func": "error",
|
||||||
"no-multi-spaces": "warn",
|
"no-multi-spaces": "warn",
|
||||||
|
|
|
||||||
|
|
@ -87,9 +87,6 @@ class App extends React.Component<AppProps & Classes, AppState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
changeState(topic: string, value: any) {
|
changeState(topic: string, value: any) {
|
||||||
// this.receiveMessage(this.props.config.topics[topic].state, String(this.props.config.topics[topic].values[value] || value));
|
|
||||||
// return;
|
|
||||||
//
|
|
||||||
const rawTopic = this.props.config.topics[topic].command;
|
const rawTopic = this.props.config.topics[topic].command;
|
||||||
if (rawTopic == null) {
|
if (rawTopic == null) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,11 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import {
|
import {
|
||||||
ListItem,
|
|
||||||
ListItemIcon,
|
|
||||||
ListItemSecondaryAction,
|
ListItemSecondaryAction,
|
||||||
ListItemText,
|
ListItemText,
|
||||||
ListSubheader
|
ListSubheader
|
||||||
} from "material-ui/List";
|
} from "material-ui/List";
|
||||||
import Switch from "material-ui/Switch";
|
import Switch from "material-ui/Switch";
|
||||||
import { renderIcon } from "utils/parseIconName";
|
|
||||||
import Input, { InputLabel } from "material-ui/Input";
|
import Input, { InputLabel } from "material-ui/Input";
|
||||||
import { FormControl } from "material-ui/Form";
|
import { FormControl } from "material-ui/Form";
|
||||||
import Select from "material-ui/Select";
|
import Select from "material-ui/Select";
|
||||||
|
|
@ -36,7 +33,7 @@ export default class UiItem<I> extends React.Component<UiItemProps<I>> {
|
||||||
changeState(next: any) {
|
changeState(next: any) {
|
||||||
if (this.props.item.topic == null) {
|
if (this.props.item.topic == null) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Undefined topic in ${control.type} "${control.text}"`
|
`Undefined topic in ${this.props.item.type} "${this.props.item.text}"`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
this.props.onChangeState(this.props.item.topic, next);
|
this.props.onChangeState(this.props.item.topic, next);
|
||||||
|
|
@ -46,6 +43,7 @@ export default class UiItem<I> extends React.Component<UiItemProps<I>> {
|
||||||
const topic: string = this.props.item.topic || "";
|
const topic: string = this.props.item.topic || "";
|
||||||
const value = this.props.state[topic];
|
const value = this.props.state[topic];
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
|
const control = this.props.item;
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Unknown topic "${control.topic}" in ${control.type} "${control.text}"`
|
`Unknown topic "${control.topic}" in ${control.type} "${control.text}"`
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue