From 30e18a749f4840844db88de9b1b79e1f9dde338a Mon Sep 17 00:00:00 2001 From: uwap Date: Sun, 14 Jan 2018 00:14:50 +0100 Subject: [PATCH] Fix eslint errors --- .eslintrc.js | 1 - src/components/App.js | 3 --- src/components/UiItemList/UiItem.js | 6 ++---- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 76f7bca..522ce82 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -43,7 +43,6 @@ module.exports = { "no-floating-decimal": "error", "no-implicit-coercion": "error", "no-implied-eval": "error", - "no-invalid-this": "error", "no-iterator": "error", "no-loop-func": "error", "no-multi-spaces": "warn", diff --git a/src/components/App.js b/src/components/App.js index cd1b5a0..d502a8f 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -87,9 +87,6 @@ class App extends React.Component { } 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; if (rawTopic == null) { return; diff --git a/src/components/UiItemList/UiItem.js b/src/components/UiItemList/UiItem.js index 82112c4..b58b8ab 100644 --- a/src/components/UiItemList/UiItem.js +++ b/src/components/UiItemList/UiItem.js @@ -2,14 +2,11 @@ import React from "react"; import _ from "lodash"; import { - ListItem, - ListItemIcon, ListItemSecondaryAction, ListItemText, ListSubheader } from "material-ui/List"; import Switch from "material-ui/Switch"; -import { renderIcon } from "utils/parseIconName"; import Input, { InputLabel } from "material-ui/Input"; import { FormControl } from "material-ui/Form"; import Select from "material-ui/Select"; @@ -36,7 +33,7 @@ export default class UiItem extends React.Component> { changeState(next: any) { if (this.props.item.topic == null) { 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); @@ -46,6 +43,7 @@ export default class UiItem extends React.Component> { const topic: string = this.props.item.topic || ""; const value = this.props.state[topic]; if (value == null) { + const control = this.props.item; throw new Error( `Unknown topic "${control.topic}" in ${control.type} "${control.text}"` );