mirror of
https://github.com/immich-app/immich.git
synced 2026-06-12 11:01:45 -07:00
chore(web): add switch case exhaustiveness lint (#29015)
This commit is contained in:
@@ -129,6 +129,7 @@ export default typescriptEslint.config(
|
||||
'@typescript-eslint/no-floating-promises': 'error',
|
||||
'@typescript-eslint/no-misused-promises': 'error',
|
||||
'@typescript-eslint/require-await': 'error',
|
||||
'@typescript-eslint/switch-exhaustiveness-check': ['error', { considerDefaultExhaustiveForUnions: true }],
|
||||
'object-shorthand': ['error', 'always'],
|
||||
'svelte/no-navigation-without-resolve': 'off',
|
||||
},
|
||||
|
||||
@@ -351,6 +351,7 @@
|
||||
closeViewer();
|
||||
break;
|
||||
}
|
||||
// no default
|
||||
}
|
||||
|
||||
onAction?.(action);
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
await goto(Route.photos());
|
||||
break;
|
||||
}
|
||||
// no default
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -316,6 +316,7 @@
|
||||
}
|
||||
break;
|
||||
}
|
||||
// no default
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -140,6 +140,7 @@
|
||||
|
||||
break;
|
||||
}
|
||||
// no default
|
||||
}
|
||||
};
|
||||
const handleAction = (action: Action) => {
|
||||
@@ -195,6 +196,7 @@
|
||||
});
|
||||
break;
|
||||
}
|
||||
// no default
|
||||
}
|
||||
};
|
||||
const handleUndoDelete = async (assets: TimelineAsset[]) => {
|
||||
|
||||
@@ -667,6 +667,7 @@ class TransformManager implements EditToolManager {
|
||||
desiredWidth = Math.max(minSize, Math.max(mouseX, 0) - x);
|
||||
break;
|
||||
}
|
||||
// no default
|
||||
}
|
||||
|
||||
// Height
|
||||
@@ -683,10 +684,14 @@ class TransformManager implements EditToolManager {
|
||||
desiredHeight = Math.max(minSize, Math.max(mouseY, 0) - y);
|
||||
break;
|
||||
}
|
||||
// no default
|
||||
}
|
||||
|
||||
// Old
|
||||
switch (this.resizeSide) {
|
||||
case ResizeBoundary.None: {
|
||||
break;
|
||||
}
|
||||
case ResizeBoundary.Left: {
|
||||
const { newWidth: w, newHeight: h } = this.keepAspectRatio(desiredWidth, height);
|
||||
const finalWidth = clamp(w, minSize, canvas.clientWidth);
|
||||
|
||||
@@ -72,12 +72,7 @@ export interface TrashAssets {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface UpdateStackAssets {
|
||||
type: 'update_stack_assets';
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export type PendingChange = AddAsset | UpdateAsset | DeleteAsset | TrashAssets | UpdateStackAssets;
|
||||
export type PendingChange = AddAsset | UpdateAsset | DeleteAsset | TrashAssets;
|
||||
|
||||
export type ScrubberMonth = {
|
||||
height: number;
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
}
|
||||
break;
|
||||
}
|
||||
// no default
|
||||
}
|
||||
|
||||
selectedRowIndex = -1;
|
||||
|
||||
@@ -98,6 +98,13 @@ function createUploadStore() {
|
||||
case UploadState.DONE: {
|
||||
break;
|
||||
}
|
||||
|
||||
case UploadState.PENDING:
|
||||
case UploadState.STARTED:
|
||||
case undefined: {
|
||||
console.error('Cannot remove uploads in progress');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return stats;
|
||||
|
||||
@@ -171,6 +171,7 @@ export class GCastDestination implements ICastDestination {
|
||||
///
|
||||
private onSessionStateChanged(event: cast.framework.SessionStateEventData) {
|
||||
switch (event.sessionState) {
|
||||
case cast.framework.SessionState.NO_SESSION:
|
||||
case cast.framework.SessionState.SESSION_ENDED: {
|
||||
this.session = null;
|
||||
break;
|
||||
@@ -180,6 +181,11 @@ export class GCastDestination implements ICastDestination {
|
||||
this.session = event.session.getSessionObj();
|
||||
break;
|
||||
}
|
||||
case cast.framework.SessionState.SESSION_START_FAILED: {
|
||||
console.error('Google Cast failed to start session:', event.errorCode);
|
||||
break;
|
||||
}
|
||||
// no default
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -104,6 +104,7 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
// no default
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -115,6 +116,7 @@
|
||||
toastManager.primary($t('admin.cleared_jobs', { values: { job: item.title } }));
|
||||
break;
|
||||
}
|
||||
// no default
|
||||
}
|
||||
} catch (error) {
|
||||
handleError(error, $t('admin.failed_job_command', { values: { command: dto.command, job: item.title } }));
|
||||
|
||||
Reference in New Issue
Block a user