Skip to content

Commit 50a4e79

Browse files
committed
web: prettier: upgrade to version 3.0.1
Between 2.8 and 3.0 prettiers generated/expected formatting changed, which is why this upgrade adds a few source code changes. Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
1 parent 153c9cb commit 50a4e79

File tree

10 files changed

+18
-17
lines changed

10 files changed

+18
-17
lines changed

.github/workflows/tacd-webui.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- uses: actions/setup-node@v3
3030
with:
3131
node-version: latest
32-
- run: npx prettier@=2.8.8 --check .
32+
- run: npx prettier@=3.0.1 --check .
3333

3434
license:
3535
name: npx license-checker

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,5 @@ guidelines:
131131
- Use `cargo fmt` after every change to the rust codebase
132132
- Use `cargo deny check license` if you have introduced new dependencies to
133133
check if they (or their dependencies) introduce license issues.
134-
- Use `npx prettier@=2.8.8 --write .` (in the web directory) after every
134+
- Use `npx prettier@=3.0.1 --write .` (in the web directory) after every
135135
change to the web codebase.

web/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

web/src/ApiDocs.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function SwaggerView(props: SwaggerViewProps) {
3737

3838
const content = useMemo(
3939
() => (openapi === undefined ? <Spinner /> : <SwaggerUI spec={openapi} />),
40-
[openapi]
40+
[openapi],
4141
);
4242

4343
useEffect(() => {
@@ -62,7 +62,7 @@ export function SwaggerView(props: SwaggerViewProps) {
6262
// [ "", "v1", "output", "{out_n}", "feedback", "voltage" ] ->
6363
// [ "", "v1", "output", "[^/]+", "feedback", "voltage" ]
6464
let frags_no_var = frags.map((el) =>
65-
el[0] === "{" && el[el.length - 1] === "}" ? "[^/]+" : el
65+
el[0] === "{" && el[el.length - 1] === "}" ? "[^/]+" : el,
6666
);
6767

6868
// [ "", "v1", "output", "[^/]+", "feedback", "voltage" ] ->
@@ -93,7 +93,7 @@ export function SwaggerView(props: SwaggerViewProps) {
9393

9494
// Filter out all the tags that are not actually used
9595
obj.tags = obj.tags.filter((t: { [n: string]: any }) =>
96-
tags_to_keep.has(t.name)
96+
tags_to_keep.has(t.name),
9797
);
9898
}
9999

web/src/ConfigEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export function ConfigEditor(props: ConfigEditorProps) {
9999
setContent(undefined);
100100

101101
fetch(props.path, { method: "PUT", body: newContent }).then(() =>
102-
loadContent()
102+
loadContent(),
103103
);
104104
}
105105
}

web/src/MqttComponents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export function MqttChart(props: MqttChartProps) {
267267
const history = useMqttHistory<Measurement, Point>(
268268
props.topic,
269269
200,
270-
measToPoint
270+
measToPoint,
271271
);
272272
let values = history.current;
273273

web/src/TacComponents.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export function SlotStatus() {
205205

206206
export function UpdateChannels() {
207207
const channels_topic = useMqttSubscription<Array<Channel>>(
208-
"/v1/tac/update/channels"
208+
"/v1/tac/update/channels",
209209
);
210210

211211
const channels = channels_topic !== undefined ? channels_topic : [];
@@ -383,7 +383,7 @@ export function ProgressNotification() {
383383

384384
export function RebootNotification() {
385385
const should_reboot = useMqttSubscription<boolean>(
386-
"/v1/tac/update/should_reboot"
386+
"/v1/tac/update/should_reboot",
387387
);
388388

389389
return (
@@ -425,7 +425,7 @@ export function UpdateContainer() {
425425

426426
export function UpdateNotification() {
427427
const channels = useMqttSubscription<Array<Channel>>(
428-
"/v1/tac/update/channels"
428+
"/v1/tac/update/channels",
429429
);
430430

431431
let updates = [];

web/src/index.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ code {
4646
}
4747

4848
.live-display {
49-
box-shadow: rgb(233, 235, 237) 0px 0px 1px 1px,
49+
box-shadow:
50+
rgb(233, 235, 237) 0px 0px 1px 1px,
5051
rgba(0, 7, 22, 0.12) 0px 1px 8px 2px;
5152
margin-top: 0.5em;
5253
image-rendering: crisp-edges;

web/src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import SettingsLabgrid from "./SettingsLabgrid";
3232
import Setup from "./Setup";
3333

3434
const root = ReactDOM.createRoot(
35-
document.getElementById("root") as HTMLElement
35+
document.getElementById("root") as HTMLElement,
3636
);
3737
root.render(
3838
<React.StrictMode>
@@ -49,5 +49,5 @@ root.render(
4949
<Route path="/setup" element={<Setup />} />
5050
</Routes>
5151
</HashRouter>
52-
</React.StrictMode>
52+
</React.StrictMode>,
5353
);

web/src/mqtt.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { useEffect, useState } from "react";
2020

2121
export const session = new Client(
2222
`ws://${window.location.hostname}:${window.location.port}/v1/mqtt`,
23-
"webinterface-" + (Math.random() * 1000000).toFixed()
23+
"webinterface-" + (Math.random() * 1000000).toFixed(),
2424
);
2525

2626
let subscriptions: {
@@ -66,7 +66,7 @@ session.connect({
6666

6767
function subscribe(
6868
topic: string,
69-
handleMessage: (m: Message | undefined) => void
69+
handleMessage: (m: Message | undefined) => void,
7070
) {
7171
if (subscriptions[topic] === undefined) {
7272
if (session.isConnected()) {
@@ -148,7 +148,7 @@ type History<M> = {
148148
export function useMqttHistory<T, M>(
149149
topic: string,
150150
length: number,
151-
format: (t: T) => M
151+
format: (t: T) => M,
152152
) {
153153
const [hist, setHist] = useState<History<M>>({ current: [] });
154154

0 commit comments

Comments
 (0)