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<{ @@ -10,17 +10,30 @@ export default class DurationInput extends React.Component<{
render() {
const duration = this.props.duration;
// const editing = this.props.onDurationChange != null;
return <div className="field durationInput">
<label>Duration</label>
<div className="fields">
<Input type="number" className="field durationInput--minutes"
value={duration.minutes} 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" />
return (
<div className="field durationInput">
<label>Duration</label>
<div className="fields">
<Input
type="number"
className="field durationInput--minutes"
value={duration.minutes}
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>;
);
}
private onMinutesChange = (e: React.SyntheticEvent<any>, { value }: InputOnChangeData) => {

4
app/components/MessagesView.tsx

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
import { observer } from "mobx-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";
@ -11,7 +11,7 @@ class MessageView extends React.Component<{ @@ -11,7 +11,7 @@ class MessageView extends React.Component<{
}> {
render() {
const { id, header, content, type } = this.props.message;
const { header, content, type } = this.props.message;
return (
<Message
header={header}

8
app/components/SectionRunnerView.tsx

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

6
app/mqtt.ts

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

4
package.json

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

Loading…
Cancel
Save