Skip to content

Commit 6808b19

Browse files
committed
xo: Fix unicorn/switch-case-braces.
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 1dd5269 commit 6808b19

File tree

3 files changed

+32
-13
lines changed

3 files changed

+32
-13
lines changed

app/renderer/js/pages/preference/preference.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,29 +63,33 @@ export class PreferenceView {
6363
this.navItem = navItem;
6464
this.nav.select(navItem);
6565
switch (navItem) {
66-
case "AddServer":
66+
case "AddServer": {
6767
initServersSection({
6868
$root: this.$settingsContainer,
6969
});
7070
break;
71+
}
7172

72-
case "General":
73+
case "General": {
7374
initGeneralSection({
7475
$root: this.$settingsContainer,
7576
});
7677
break;
78+
}
7779

78-
case "Organizations":
80+
case "Organizations": {
7981
initConnectedOrgSection({
8082
$root: this.$settingsContainer,
8183
});
8284
break;
85+
}
8386

84-
case "Network":
87+
case "Network": {
8588
initNetworkSection({
8689
$root: this.$settingsContainer,
8790
});
8891
break;
92+
}
8993

9094
case "Shortcuts": {
9195
initShortcutsSection({
@@ -94,8 +98,9 @@ export class PreferenceView {
9498
break;
9599
}
96100

97-
default:
101+
default: {
98102
((n: never) => n)(navItem);
103+
}
99104
}
100105

101106
window.location.hash = `#${navItem}`;

app/renderer/js/tray.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,21 @@ let unread = 0;
3636

3737
const trayIconSize = (): number => {
3838
switch (process.platform) {
39-
case "darwin":
39+
case "darwin": {
4040
return 20;
41-
case "win32":
41+
}
42+
43+
case "win32": {
4244
return 100;
43-
case "linux":
45+
}
46+
47+
case "linux": {
4448
return 100;
45-
default:
49+
}
50+
51+
default: {
4652
return 80;
53+
}
4754
}
4855
};
4956

tests/setup.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,25 @@ function getAppDataDir() {
3030
let base;
3131

3232
switch (process.platform) {
33-
case "darwin":
33+
case "darwin": {
3434
base = path.join(process.env.HOME, "Library", "Application Support");
3535
break;
36-
case "linux":
36+
}
37+
38+
case "linux": {
3739
base =
3840
process.env.XDG_CONFIG_HOME ?? path.join(process.env.HOME, ".config");
3941
break;
40-
case "win32":
42+
}
43+
44+
case "win32": {
4145
base = process.env.APPDATA;
4246
break;
43-
default:
47+
}
48+
49+
default: {
4450
throw new Error("Could not detect app data dir base.");
51+
}
4552
}
4653

4754
console.log("Detected App Data Dir base:", base);

0 commit comments

Comments
 (0)