diff --git a/zeppelin-web-angular/src/app/app.module.ts b/zeppelin-web-angular/src/app/app.module.ts index af099ac17e5..a630b2d9be5 100644 --- a/zeppelin-web-angular/src/app/app.module.ts +++ b/zeppelin-web-angular/src/app/app.module.ts @@ -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 } }, diff --git a/zeppelin-web-angular/src/app/key-binding/notebook-paragraph-keyboard-event-handler.ts b/zeppelin-web-angular/src/app/key-binding/notebook-paragraph-keyboard-event-handler.ts index 5ebffd8fedf..3c6e8508c83 100644 --- a/zeppelin-web-angular/src/app/key-binding/notebook-paragraph-keyboard-event-handler.ts +++ b/zeppelin-web-angular/src/app/key-binding/notebook-paragraph-keyboard-event-handler.ts @@ -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` -// 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; // Referenced only via `typeof` below to derive a type; the runtime binding is intentionally unused. // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -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]; diff --git a/zeppelin-web-angular/src/app/pages/workspace/interpreter/create-repository-modal/create-repository-modal.component.ts b/zeppelin-web-angular/src/app/pages/workspace/interpreter/create-repository-modal/create-repository-modal.component.ts index e254d6870dc..0813facdcd6 100644 --- a/zeppelin-web-angular/src/app/pages/workspace/interpreter/create-repository-modal/create-repository-modal.component.ts +++ b/zeppelin-web-angular/src/app/pages/workspace/interpreter/create-repository-modal/create-repository-modal.component.ts @@ -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); + } satisfies Record); } }