Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions zeppelin-web-angular/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ registerLocaleData(en);
useValue: {
defaultEditorOption: {
scrollBeyondLastLine: false
// TODO: Change 'as' to 'satisfies' when typescript version is over 4.9 to detect unsupported editor options at compile time.
} as JoinedEditorOptions,
} satisfies JoinedEditorOptions,
onLoad: loadMonaco
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,7 @@ export const ParagraphActionToHandlerName = {
[ParagraphActions.PasteLine]: 'handlePasteLine',
[ParagraphActions.SearchInsideCode]: 'handleSearchInsideCode',
[ParagraphActions.FindInCode]: 'handleFindInCode'
} as const;
// TODO: Replace `as const` with
// `satisfies Record<ParagraphActions, keyof NotebookParagraphKeyboardEventHandler>`
// when typescript version is over 4.9.
// This allows checking both keys and values at the type level,
// while preserving the binding between them.
} as const satisfies Record<ParagraphActions, keyof NotebookParagraphKeyboardEventHandler>;

// Referenced only via `typeof` below to derive a type; the runtime binding is intentionally unused.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand All @@ -85,10 +80,7 @@ const MonacoHandledParagraphActions = [
ParagraphActions.CutLine,
ParagraphActions.PasteLine,
ParagraphActions.SearchInsideCode
] as const;
// TODO: Replace `as const` with `satisfies ParagraphActions[]` when typescript version is over 4.9.
// This ensures that the array contains only valid ParagraphActions,
// while preserving the literal value of the each element.
] as const satisfies ParagraphActions[];

type MonacoHandledParagraphAction = (typeof MonacoHandledParagraphActions)[number];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export class InterpreterCreateRepositoryModalComponent extends DestroyHookCompon
],
proxyLogin: '',
proxyPassword: ''
// TODO: Change 'as' to 'satisfies' when typescript version is over 4.9 to detect unsupported editor options at compile time.
} as Record<keyof CreateInterpreterRepositoryForm, unknown>);
} satisfies Record<keyof CreateInterpreterRepositoryForm, unknown>);
}
}
Loading