Browse Source

Fixed all lint issues

update-deps
Alex Mikhalev 7 years ago
parent
commit
4e5abdd0de
  1. 33
      app/components/DurationInput.tsx
  2. 4
      app/components/MessagesView.tsx
  3. 8
      app/components/SectionRunnerView.tsx
  4. 6
      app/mqtt.ts
  5. 4
      package.json

33
app/components/DurationInput.tsx

@ -10,17 +10,30 @@ export default class DurationInput extends React.Component<{
render() { render() {
const duration = this.props.duration; const duration = this.props.duration;
// const editing = this.props.onDurationChange != null; // const editing = this.props.onDurationChange != null;
return <div className="field durationInput"> return (
<label>Duration</label> <div className="field durationInput">
<div className="fields"> <label>Duration</label>
<Input type="number" className="field durationInput--minutes" <div className="fields">
value={duration.minutes} onChange={this.onMinutesChange} <Input
label="M" labelPosition="right" /> type="number"
<Input type="number" className="field durationInput--seconds" className="field durationInput--minutes"
value={duration.seconds} onChange={this.onSecondsChange} max="60" value={duration.minutes}
label="S" labelPosition="right" /> onChange={this.onMinutesChange}
label="M"
labelPosition="right"
/>
<Input
type="number"
className="field durationInput--seconds"
value={duration.seconds}
onChange={this.onSecondsChange}
max="60"
label="S"
labelPosition="right"
/>
</div>
</div> </div>
</div>; );
} }
private onMinutesChange = (e: React.SyntheticEvent<any>, { value }: InputOnChangeData) => { private onMinutesChange = (e: React.SyntheticEvent<any>, { value }: InputOnChangeData) => {

4
app/components/MessagesView.tsx

@ -1,6 +1,6 @@
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import * as React from "react"; import * as React from "react";
import { Message, MessageList, TransitionGroup } from "semantic-ui-react"; import { Message, TransitionGroup } from "semantic-ui-react";
import { Message as UiMessage, UiStore } from "@app/ui"; import { Message as UiMessage, UiStore } from "@app/ui";
@ -11,7 +11,7 @@ class MessageView extends React.Component<{
}> { }> {
render() { render() {
const { id, header, content, type } = this.props.message; const { header, content, type } = this.props.message;
return ( return (
<Message <Message
header={header} header={header}

8
app/components/SectionRunnerView.tsx

@ -7,8 +7,10 @@ import { SectionRunner } from "@common/sprinklers";
@observer @observer
export default class SectionRunnerView extends React.Component<{ sectionRunner: SectionRunner }, {}> { export default class SectionRunnerView extends React.Component<{ sectionRunner: SectionRunner }, {}> {
render() { render() {
return <Segment> return (
<h4>Section Runner Queue</h4> <Segment>
</Segment>; <h4>Section Runner Queue</h4>
</Segment>
);
} }
} }

6
app/mqtt.ts

@ -1,4 +1,3 @@
import { EventEmitter } from "events";
import "paho-mqtt"; import "paho-mqtt";
import MQTT = Paho.MQTT; import MQTT = Paho.MQTT;
@ -14,7 +13,7 @@ import {
SprinklersDevice, SprinklersDevice,
TimeOfDay, TimeOfDay,
} from "@common/sprinklers"; } from "@common/sprinklers";
import { checkedIndexOf, getRandomId } from "@common/utils"; import { checkedIndexOf } from "@common/utils";
export class MqttApiClient implements ISprinklersApi { export class MqttApiClient implements ISprinklersApi {
client: MQTT.Client; client: MQTT.Client;
@ -158,6 +157,7 @@ class MqttSprinklersDevice extends SprinklersDevice {
let matches = topic.match(/^sections(?:\/(\d+)(?:\/?(.+))?)?$/); let matches = topic.match(/^sections(?:\/(\d+)(?:\/?(.+))?)?$/);
if (matches != null) { if (matches != null) {
//noinspection JSUnusedLocalSymbols //noinspection JSUnusedLocalSymbols
/* tslint:disable-next-line:no-unused-variable */
const [_topic, secStr, subTopic] = matches; const [_topic, secStr, subTopic] = matches;
// console.log(`section: ${secStr}, topic: ${subTopic}, payload: ${payload}`); // console.log(`section: ${secStr}, topic: ${subTopic}, payload: ${payload}`);
if (!secStr) { // new number of sections if (!secStr) { // new number of sections
@ -175,6 +175,7 @@ class MqttSprinklersDevice extends SprinklersDevice {
matches = topic.match(/^programs(?:\/(\d+)(?:\/?(.+))?)?$/); matches = topic.match(/^programs(?:\/(\d+)(?:\/?(.+))?)?$/);
if (matches != null) { if (matches != null) {
//noinspection JSUnusedLocalSymbols //noinspection JSUnusedLocalSymbols
/* tslint:disable-next-line:no-unused-variable */
const [_topic, progStr, subTopic] = matches; const [_topic, progStr, subTopic] = matches;
// console.log(`program: ${progStr}, topic: ${subTopic}, payload: ${payload}`); // console.log(`program: ${progStr}, topic: ${subTopic}, payload: ${payload}`);
if (!progStr) { // new number of programs if (!progStr) { // new number of programs
@ -197,6 +198,7 @@ class MqttSprinklersDevice extends SprinklersDevice {
matches = topic.match(/^responses\/(\d+)$/); matches = topic.match(/^responses\/(\d+)$/);
if (matches != null) { if (matches != null) {
//noinspection JSUnusedLocalSymbols //noinspection JSUnusedLocalSymbols
/* tslint:disable-next-line:no-unused-variable */
const [_topic, respIdStr] = matches; const [_topic, respIdStr] = matches;
console.log(`response: ${respIdStr}`); console.log(`response: ${respIdStr}`);
const respId = parseInt(respIdStr, 10); const respId = parseInt(respIdStr, 10);

4
package.json

@ -12,8 +12,8 @@
"watch:server": "yarn build:server --watch", "watch:server": "yarn build:server --watch",
"start:dev-server": "webpack-dev-server --config ./app/webpack/dev.config.js", "start:dev-server": "webpack-dev-server --config ./app/webpack/dev.config.js",
"start": "node dist/index.js", "start": "node dist/index.js",
"lint:app": "tslint --project app --force", "lint:app": "tslint --project app --force --format verbose",
"lint:server": "tslint --project server --force", "lint:server": "tslint --project server --force --format verbose",
"lint": "run-p lint:*" "lint": "run-p lint:*"
}, },
"repository": { "repository": {

Loading…
Cancel
Save