diff --git a/app/components/DeviceView.tsx b/app/components/DeviceView.tsx index b1554a1..138dd7c 100644 --- a/app/components/DeviceView.tsx +++ b/app/components/DeviceView.tsx @@ -28,7 +28,7 @@ interface DeviceViewProps { } class DeviceView extends React.Component { - device: SprinklersDevice; + device!: SprinklersDevice; componentWillMount() { this.updateDevice(); diff --git a/app/components/ProgramTable.tsx b/app/components/ProgramTable.tsx index 3f3038a..602b309 100644 --- a/app/components/ProgramTable.tsx +++ b/app/components/ProgramTable.tsx @@ -5,7 +5,7 @@ import * as React from "react"; import { Button, Table } from "semantic-ui-react"; import { Duration } from "@common/Duration"; -import { Program, Schedule, TimeOfDay, Weekday, DateOfYear, Section } from "@common/sprinklers"; +import { DateOfYear, Program, Schedule, Section, TimeOfDay, Weekday } from "@common/sprinklers"; function timeToString(time: TimeOfDay) { return moment(time).format("LTS"); diff --git a/app/components/RunSectionForm.tsx b/app/components/RunSectionForm.tsx index c264da7..9b0d364 100644 --- a/app/components/RunSectionForm.tsx +++ b/app/components/RunSectionForm.tsx @@ -15,8 +15,8 @@ export default class RunSectionForm extends React.Component<{ duration: Duration, section: number | "", }> { - constructor() { - super(); + constructor(props: any, context?: any) { + super(props, context); this.state = { duration: new Duration(0, 0), section: "", diff --git a/app/components/SectionTable.tsx b/app/components/SectionTable.tsx index 88da4ff..34617f5 100644 --- a/app/components/SectionTable.tsx +++ b/app/components/SectionTable.tsx @@ -20,7 +20,7 @@ export default class SectionTable extends React.Component<{ sections: Section[] "section--state-false": !state, }); const sectionState = state ? - ( Irrigating) + ( Irrigating) : "Not irrigating"; return ( diff --git a/app/state/inject.tsx b/app/state/inject.tsx index 1aec037..da8a54f 100644 --- a/app/state/inject.tsx +++ b/app/state/inject.tsx @@ -33,7 +33,7 @@ type Omit = {[P in Diff]: T[P]}; export function injectState

(Component: React.ComponentType

) { return class extends React.Component> { static contextTypes = providedStateContextTypes; - context: IProvidedStateContext; + context!: IProvidedStateContext; render() { const state = this.context.providedState; diff --git a/app/state/websocket.ts b/app/state/websocket.ts index e5e8d7a..eb60718 100644 --- a/app/state/websocket.ts +++ b/app/state/websocket.ts @@ -28,7 +28,7 @@ export class WebSprinklersDevice extends s.SprinklersDevice { export class WebApiClient implements s.ISprinklersApi { readonly webSocketUrl: string; - socket: WebSocket; + socket!: WebSocket; device: WebSprinklersDevice; nextDeviceRequestId = Math.round(Math.random() * 1000000); diff --git a/app/webpack.config.js b/app/webpack.config.js index 6a31719..e187bc1 100644 --- a/app/webpack.config.js +++ b/app/webpack.config.js @@ -2,11 +2,8 @@ const path = require("path"); const webpack = require("webpack"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -const ExtractTextPlugin = require("extract-text-webpack-plugin"); const CaseSensitivePathsPlugin = require("case-sensitive-paths-webpack-plugin"); -const WatchMissingNodeModulesPlugin = require("react-dev-utils/WatchMissingNodeModulesPlugin"); -// const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); -const MinifyPlugin = require("babel-minify-webpack-plugin"); +const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); const cssnext = require("postcss-cssnext"); const { getClientEnvironment } = require("../env"); @@ -62,82 +59,32 @@ const rules = (env) => { // "style" loader turns CSS into JS modules that inject