chore: Enforce a few house rules via eslint (#2539)

This commit is contained in:
Dermot Duffy
2026-06-30 17:45:13 -07:00
committed by dermotduffy
parent 5572ec728e
commit 921d45e577
100 changed files with 479 additions and 295 deletions
@@ -56,7 +56,7 @@ export class MicrophoneActionsController {
}
this._callAnswered = answered;
if (answered) {
this._unmuteIfConfigured('call');
void this._unmuteIfConfigured('call');
} else {
this._muteIfConfigured('call');
}
@@ -106,7 +106,10 @@ export class MicrophoneActionsController {
this._options?.microphoneManager &&
this._options.autoUnmuteConditions?.includes(condition)
) {
await this._options.microphoneManager.unmute();
// A denied or missing microphone already shows in the UI: the menu
// microphone button switches to its forbidden icon. A failed auto-unmute
// has nothing more to act on.
await this._options.microphoneManager.unmute().catch(() => {});
}
}
@@ -68,7 +68,7 @@ export class MediaActionsController {
public setMicrophoneState(state: MicrophoneState): void {
const previous = this._microphoneState;
this._microphoneState = state;
this._microphoneStateChangeHandler(previous, state);
void this._microphoneStateChangeHandler(previous, state);
}
// Audio-out auto-mute/unmute driven by call answer: unmute when the call
@@ -85,10 +85,10 @@ export class MediaActionsController {
this._callAnswered = answered;
if (answered) {
this._pendingCallStartAction = true;
this._applyPendingCallStartAction();
void this._applyPendingCallStartAction();
} else {
this._pendingCallStartAction = false;
this._muteTargetIfConfigured('call');
void this._muteTargetIfConfigured('call');
}
}
@@ -260,7 +260,7 @@ export class MediaFilterController {
const queryCameraIDs = query.getAllCameraIDs();
const cameraID = queryCameraIDs.size === 1 ? [...queryCameraIDs][0] : undefined;
this._viewManager?.setViewByParametersWithExistingQuery({
void this._viewManager?.setViewByParametersWithExistingQuery({
params: {
query,
// If single camera, set it as the active camera for menu navigation
@@ -9,7 +9,7 @@ interface MediaLoadedInfoSinkConfig {
// notification.
getTargetID: () => string | null;
// Fires when the active info changes — i.e. when the active target's entry
// Fires when the active info changes -- i.e. when the active target's entry
// transitions (load arrives, abort, or selection changes the active entry).
// Loads for other targets are cached but do not fire the callback.
callback?: (info: MediaLoadedInfo | null) => void;
@@ -28,7 +28,7 @@ interface MediaLoadedInfoSinkConfig {
* user selects a slide whose media has already loaded, the sink immediately
* exposes the cached entry.
*
* Lifecycle asymmetry — `callback` fires on:
* Lifecycle asymmetry -- `callback` fires on:
* - the active target's load arrival,
* - the active target's source aborting (with `null`), and
* - selection changing to / from a target whose active info differs.
@@ -46,7 +46,7 @@ export class MediaLoadedInfoSinkController implements ReactiveController {
// stale abort can't blow away an entry that's since been overwritten.
private _byTarget = new Map<string, MediaLoadedInfo>();
// The targetID whose info we last surfaced — drives `hostUpdated` change
// The targetID whose info we last surfaced -- drives `hostUpdated` change
// detection. `_lastActiveInfo` records what the callback last saw, so we
// don't fire it for no-op selection changes (e.g. selection changes but
// both old and new are null/loaded with the same info reference).
@@ -67,7 +67,7 @@ export class MediaLoadedInfoSinkController implements ReactiveController {
}
public hostUpdated(): void {
// Detect selection changes — `getTargetID` is owned by the host and may
// Detect selection changes -- `getTargetID` is owned by the host and may
// flip when its props change (carousel slide change, view change, etc.).
const newID = this._config.getTargetID();
if (newID !== this._lastActiveTargetID) {
@@ -53,7 +53,7 @@ export class MediaLoadedInfoSourceController implements ReactiveController {
private _abort: AbortController | null = null;
// Survives disconnect so we can re-dispatch on reconnect. Only ever holds
// info validated by `set` — i.e., always has a targetID.
// info validated by `set` -- i.e., always has a targetID.
private _lastSet: TargetedMediaLoadedInfo | null = null;
constructor(
@@ -67,7 +67,7 @@ export class MediaLoadedInfoSourceController implements ReactiveController {
public hostConnected(): void {
// Two early-returns:
// - `!_lastSet`: nothing to replay — either the host has never seen a
// - `!_lastSet`: nothing to replay -- either the host has never seen a
// media load or the cache was discarded as stale on a prior reconnect
// (see below).
// - `_abort` non-null: a dispatch is already live, meaning we're already
@@ -79,7 +79,7 @@ export class MediaLoadedInfoSourceController implements ReactiveController {
return;
}
// Revalidate against the current targetID — the host's property may have
// Revalidate against the current targetID -- the host's property may have
// flipped while we were disconnected. Replaying the cached info under a
// stale targetID would misregister with the manager.
if (this._lastSet.targetID === this._config.getTargetID()) {
+2 -2
View File
@@ -55,7 +55,7 @@ export const navigateUp = (options?: FolderNavigationParamaters | null): void =>
},
);
options?.viewManagerEpoch.manager.setViewByParametersWithExistingQuery({
void options?.viewManagerEpoch.manager.setViewByParametersWithExistingQuery({
params: { query },
});
};
@@ -77,7 +77,7 @@ export const navigateToFolder = (
},
);
options?.viewManagerEpoch?.manager.setViewByParametersWithExistingQuery({
void options?.viewManagerEpoch?.manager.setViewByParametersWithExistingQuery({
params: { query },
});
};
+1 -1
View File
@@ -48,7 +48,7 @@ export class PTZDragController implements ReactiveController {
// continuous mode. Below that threshold, drag-end dispatches relative.
private _continuous = false;
// When a pinch occurs mid-drag, the drag is "poisoned" — all remaining
// When a pinch occurs mid-drag, the drag is "poisoned" -- all remaining
// drag events for that gesture are ignored to prevent stray pan/tilt.
private _dragCancelledByPinch = false;
+1 -1
View File
@@ -64,7 +64,7 @@ export class SignedURLController implements ReactiveController {
// When the endpoint requires signing or proxying, the URL must go through
// the async resolution path. For proxied URLs, under no circumstances
// should we fall back to returning the unproxied URL — doing so risks
// should we fall back to returning the unproxied URL -- doing so risks
// leaking traffic or causing mixed-content errors.
if (options.proxyConfig?.enabled || options.endpoint?.sign) {
return this._value;
+1 -1
View File
@@ -408,7 +408,7 @@ export class TimelineController {
this._setTargetBarAppropriately(targetTime);
}
this._throttledSetViewDuringRangeChange(targetTime, properties);
void this._throttledSetViewDuringRangeChange(targetTime, properties);
}
}