Skip to content

Commit 66d01f5

Browse files
committed
Add more compiler checks
1 parent e4a1dde commit 66d01f5

11 files changed

Lines changed: 31 additions & 24 deletions

src/lib/device/data_store.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ObjectMonitor } from "@device-ui/lib/core/object_monitor";
22
import { ArrayQueue } from "@device-ui/lib/core/array_queue";
33
import { Formatter } from "@device-ui/lib/fmt/formatter";
4-
import { Fetcher } from "@device-ui/lib/http/fetcher";
54
import { FetchHandler } from "@device-ui/lib/http/fetch_handler";
65
import { DataHolder } from "@device-ui/lib/device/data_holder";
76

src/lib/device/http_locator.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Fetcher } from "@device-ui/lib/http/fetcher";
21
import { HTTPFetcher } from "@device-ui/lib/http/http_fetcher";
32
import { HTTPOps } from "@device-ui/lib/algo/http_ops";
43
import { Locator } from "@device-ui/lib/device/locator";

src/lib/system/notification_dispatcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class NotificationDispatcher implements Notificator {
7777
severity,
7878
opts.modality,
7979
(n) => {
80-
return queue.remove(notification);
80+
return queue.remove(n);
8181
},
8282
);
8383

src/ui/preact/basic_config_component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ export abstract class BasicConfigComponent extends Component<
3939
}
4040

4141
// Read config on component mounting.
42-
async componentDidMount() {
42+
override async componentDidMount() {
4343
await this.readConfig();
4444
}
4545

46-
componentWillUnmount() {
46+
override componentWillUnmount() {
4747
this.setState({
4848
data: null,
4949
loading: false,

src/ui/preact/device_status_component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class DeviceStatusComponent
8686
};
8787
}
8888

89-
async componentDidMount() {
89+
override async componentDidMount() {
9090
let error: Error | null = null;
9191

9292
error = this.props.telemetryStore.add(this);
@@ -111,7 +111,7 @@ export class DeviceStatusComponent
111111
}
112112
}
113113

114-
componentWillUnmount() {
114+
override componentWillUnmount() {
115115
let error: Error | null = null;
116116

117117
error = this.props.telemetryStore.remove(this);

src/ui/preact/form_config_component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class FormConfigComponent extends BasicConfigComponent {
8787
onClose={this.props.onClose}
8888
data={this.state.data}
8989
setData={this.setData}
90-
ignoreKeys={this.props.ignoreKeys}
90+
ignoreKeys={this.props.ignoreKeys ?? []}
9191
/>
9292
)}
9393

src/ui/preact/markdown_component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ export class MarkdownComponent
2626
this.state = { isOpen: false };
2727
}
2828

29-
async componentDidMount() {
29+
override async componentDidMount() {
3030
this.props.stateMonitor.setMonitor(this);
3131
}
3232

33-
componentWillUnmount() {
33+
override componentWillUnmount() {
3434
this.props.stateMonitor.setMonitor(null);
3535
this.close();
3636
}

src/ui/preact/navigation_component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class NavigationComponent extends Component<
7171
);
7272
}
7373

74-
componentWillUnmount() {
74+
override componentWillUnmount() {
7575
this.helpState.set(false);
7676
}
7777

src/ui/preact/notification_component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ export class NotificationComponent
4747
};
4848
}
4949

50-
componentDidMount() {
50+
override componentDidMount() {
5151
this.props.alertQueue.setMonitor(this);
5252
this.props.confirmQueue.setMonitor(this);
5353
}
5454

55-
componentWillUnmount() {
55+
override componentWillUnmount() {
5656
this.resetNotifications();
5757
}
5858

src/ui/preact/sensor/soil/analog_sensor_component.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ class SensorData {
2020
readonly status_progress: number;
2121

2222
constructor(data: Record<string, any> = {}) {
23-
this.raw = data.raw ?? 0;
24-
this.voltage = data.voltage ?? 0;
25-
this.moisture = data.moisture ?? 0;
26-
this.prev_status = data.prev_status ?? "";
27-
this.curr_status = data.curr_status ?? "";
28-
this.prev_status_dur = data.prev_status_dur ?? 0;
29-
this.curr_status_dur = data.curr_status_dur ?? 0;
30-
this.write_count = data.write_count ?? 0;
31-
this.status_progress = data.status_progress ?? 0;
23+
this.raw = data["raw"] ?? 0;
24+
this.voltage = data["voltage"] ?? 0;
25+
this.moisture = data["moisture"] ?? 0;
26+
this.prev_status = data["prev_status"] ?? "";
27+
this.curr_status = data["curr_status"] ?? "";
28+
this.prev_status_dur = data["prev_status_dur"] ?? 0;
29+
this.curr_status_dur = data["curr_status_dur"] ?? 0;
30+
this.write_count = data["write_count"] ?? 0;
31+
this.status_progress = data["status_progress"] ?? 0;
3232
}
3333
}
3434

@@ -84,7 +84,7 @@ export class AnalogSensorComponent extends Component<
8484
};
8585
}
8686

87-
async componentDidMount() {
87+
override async componentDidMount() {
8888
const error = this.props.store.add(this);
8989
if (error) {
9090
console.error(
@@ -93,7 +93,7 @@ export class AnalogSensorComponent extends Component<
9393
}
9494
}
9595

96-
componentWillUnmount() {
96+
override componentWillUnmount() {
9797
const error = this.props.store.remove(this);
9898
if (error) {
9999
console.error(

0 commit comments

Comments
 (0)