Skip to content

Commit f17308f

Browse files
committed
fix: lint issues
1 parent 5331401 commit f17308f

File tree

6 files changed

+17
-20
lines changed

6 files changed

+17
-20
lines changed

addons/camera/src/main/server.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ async function createServer() {
5252
}
5353

5454
async function startServer() {
55-
if (!currentServer) {
56-
currentServer = createServer()
57-
}
55+
currentServer ??= createServer()
5856
return currentServer
5957
}
6058

addons/launcher/src/renderer/launcher.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ export async function openLauncher(launcher: Launcher, options: OpenLauncherOpti
7777
}
7878
return tab
7979
}
80-
if (!profile) {
81-
profile = getLauncherProfile(launcher)
82-
}
80+
profile ??= getLauncherProfile(launcher)
8381
if (duplicate) {
8482
return commas.workspace.createTerminalTab(profile, {
8583
command,

eslint.config.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,14 @@ export default config({
5151
'vue/prefer-import-from-vue': 'off',
5252
},
5353
},
54+
{
55+
// FIXME: `@excalidraw/excalidraw` has error exports
56+
files: ['addons/paint/src/renderer/excalidraw.ts'],
57+
rules: {
58+
'import-x/no-duplicates': 'off',
59+
'import-x/order': 'off',
60+
'galaxy/import-extensions': 'off',
61+
},
62+
},
5463
],
5564
})

src/main/lib/terminal.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,10 @@ async function createTerminal(
5252
if (!shell) {
5353
shell = settings['terminal.shell.path'] || getDefaultShell()!
5454
}
55-
if (!args) {
56-
args = process.platform === 'win32'
57-
? settings['terminal.shell.windowsArgs']
58-
: settings['terminal.shell.args']
59-
}
60-
if (!env) {
61-
env = settings['terminal.shell.env']
62-
}
55+
args ??= process.platform === 'win32'
56+
? settings['terminal.shell.windowsArgs']
57+
: settings['terminal.shell.args']
58+
env ??= settings['terminal.shell.env']
6359
let runtimeEnv: Record<string, string> = {
6460
...getDefaultEnv(),
6561
...env,

src/renderer/compositions/terminal.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -916,9 +916,7 @@ export function appendTerminalTab(tab: TerminalTab, fromIndex: number, direction
916916
if (!tab.group) {
917917
tab.group = generateGroup()
918918
}
919-
if (!tab.position) {
920-
tab.position = { row: 0, col: 0 }
921-
}
919+
tab.position ??= { row: 0, col: 0 }
922920
movingTab.group = tab.group
923921
switch (direction) {
924922
case 'top':

src/shared/helper.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
type IDIterator = (id: bigint) => bigint
22

33
export function createIDGenerator(iterator?: IDIterator) {
4-
if (!iterator) {
5-
iterator = id => id + 1n
6-
}
4+
iterator ??= id => id + 1n
75
let id = 1n
86
return () => {
97
id = iterator(id)

0 commit comments

Comments
 (0)