Introduce oxlint, and fix lint warnings

This commit is contained in:
James Babcock committed 2026-09-29 11:54:22 -07:00
1 parent cb6dddd120
commit 06146c2b08
89 files changed
+818 -469

No files matched your search

+2 -3
View File
@@ -344,7 +344,6 @@ class GlancePreviewLayer implements Layer {
export function createGlanceboardAppWindow(options: InProcessAppOptions): InProcessWindow {
let previewVisible = false;
const heightMode = () => previewVisible && glanceLayoutSetting.get() === "2x3" ? "max" as const : "medium" as const;
let unsubscribeSettings: (() => void) | undefined;
const app = createInProcessWindow({
appId: "glanceboard",
windowId: GLANCEBOARD_WINDOW_ID,
@@ -367,10 +366,10 @@ export function createGlanceboardAppWindow(options: InProcessAppOptions): InProc
removeSurface: options.removeSurface,
reconfigureSurface: options.reconfigureSurface,
onClosed: () => {
unsubscribeSettings?.();
unsubscribeSettings();
options.onClosed();
},
});
unsubscribeSettings = onAnySettingChanged(() => app.setHeightMode(heightMode()));
const unsubscribeSettings = onAnySettingChanged(() => app.setHeightMode(heightMode()));
return app;
}
+1 -1
View File
@@ -16,7 +16,7 @@ export const GLANCE_WIDGETS: readonly GlanceWidgetDefinition[] = [
{ id: "music", label: "Music", create: () => new MusicWidget() },
];
export function findGlanceWidget(id: GlanceWidgetId | string): GlanceWidgetDefinition | null {
export function findGlanceWidget(id: GlanceWidgetId | (string & {})): GlanceWidgetDefinition | null {
return GLANCE_WIDGETS.find((widget) => widget.id === id) ?? null;
}
@@ -26,7 +26,7 @@ const BOTTOM_MARGIN = 2;
* once the snapshot is in.
*/
export class TerminalWidget implements GlanceWidget {
private snapshot: TerminalSessionsSnapshot | undefined = readWorkerState(TERMINAL_SESSIONS_STATE_KEY);
private snapshot = readWorkerState(TERMINAL_SESSIONS_STATE_KEY) as TerminalSessionsSnapshot | undefined;
private unsubscribe: (() => void) | null = null;
private requestRender: (() => void) | null = null;
private phase = 0;
@@ -34,9 +34,9 @@ export class TerminalWidget implements GlanceWidget {
start(requestRender: () => void): void {
this.requestRender = requestRender;
this.snapshot = readWorkerState(TERMINAL_SESSIONS_STATE_KEY);
this.unsubscribe = onWorkerStateChanged<TerminalSessionsSnapshot>(TERMINAL_SESSIONS_STATE_KEY, (snapshot) => {
this.snapshot = snapshot;
this.snapshot = readWorkerState(TERMINAL_SESSIONS_STATE_KEY) as TerminalSessionsSnapshot | undefined;
this.unsubscribe = onWorkerStateChanged(TERMINAL_SESSIONS_STATE_KEY, (snapshot) => {
this.snapshot = snapshot as TerminalSessionsSnapshot;
this.syncAnimation();
requestRender();
});