From f5de8ac43c248c652a15aa1ce3f0f13c74a1a600 Mon Sep 17 00:00:00 2001 From: Salmen Hichri Date: Sat, 11 May 2024 15:41:47 +0100 Subject: [PATCH] Fixed some @ts-ignore comments --- packages/css/themes/modules.d.ts | 1 + packages/css/themes/rollup.config.ts | 2 -- packages/extra/highlighter/modules.d.ts | 1 + packages/extra/highlighter/rollup.config.ts | 1 - packages/js/core/src/exports/aiContext/aiContext.ts | 1 - packages/js/core/src/exports/aiContext/dataSyncService.ts | 3 +-- packages/js/core/src/exports/aiContext/tasksService.ts | 2 -- packages/js/core/src/logic/chat/chatRoom/chatRoom.model.ts | 5 ++--- packages/js/langchain/rollup.config.ts | 1 - packages/js/nlbridge/rollup.config.ts | 1 - 10 files changed, 5 insertions(+), 13 deletions(-) create mode 100644 packages/css/themes/modules.d.ts create mode 100644 packages/extra/highlighter/modules.d.ts diff --git a/packages/css/themes/modules.d.ts b/packages/css/themes/modules.d.ts new file mode 100644 index 00000000..b6d8859a --- /dev/null +++ b/packages/css/themes/modules.d.ts @@ -0,0 +1 @@ +declare module 'postcss-csso'; diff --git a/packages/css/themes/rollup.config.ts b/packages/css/themes/rollup.config.ts index 781a2616..8daa1665 100644 --- a/packages/css/themes/rollup.config.ts +++ b/packages/css/themes/rollup.config.ts @@ -1,7 +1,5 @@ -// @ts-ignore import csso from 'postcss-csso'; import postcssImport from 'postcss-import'; -// @ts-ignore import postcssNested from 'postcss-nested'; import {LogLevel, RollupOptions} from 'rollup'; import postcss from 'rollup-plugin-postcss'; diff --git a/packages/extra/highlighter/modules.d.ts b/packages/extra/highlighter/modules.d.ts new file mode 100644 index 00000000..b6d8859a --- /dev/null +++ b/packages/extra/highlighter/modules.d.ts @@ -0,0 +1 @@ +declare module 'postcss-csso'; diff --git a/packages/extra/highlighter/rollup.config.ts b/packages/extra/highlighter/rollup.config.ts index 165f5d81..ca309aba 100644 --- a/packages/extra/highlighter/rollup.config.ts +++ b/packages/extra/highlighter/rollup.config.ts @@ -3,7 +3,6 @@ import {nodeResolve} from '@rollup/plugin-node-resolve'; import replace from '@rollup/plugin-replace'; import strip from '@rollup/plugin-strip'; import terser from '@rollup/plugin-terser'; -// @ts-ignore import csso from 'postcss-csso'; import postcssImport from 'postcss-import'; import {LogLevel, RollupOptions} from 'rollup'; diff --git a/packages/js/core/src/exports/aiContext/aiContext.ts b/packages/js/core/src/exports/aiContext/aiContext.ts index 5b089604..d0a74d89 100644 --- a/packages/js/core/src/exports/aiContext/aiContext.ts +++ b/packages/js/core/src/exports/aiContext/aiContext.ts @@ -156,7 +156,6 @@ class AiContextImpl implements AiContext { // Status can change to 'destroyed' if the context is destroyed while adapter.set is in progress. // In that case, we should not set the contextId and we should immediately clear the context. - // @ts-ignore if (this.status === 'destroyed') { if (result.success) { await this.theDataSyncService?.resetContextData(); diff --git a/packages/js/core/src/exports/aiContext/dataSyncService.ts b/packages/js/core/src/exports/aiContext/dataSyncService.ts index a5417dfc..b80947d3 100644 --- a/packages/js/core/src/exports/aiContext/dataSyncService.ts +++ b/packages/js/core/src/exports/aiContext/dataSyncService.ts @@ -153,9 +153,8 @@ export class DataSyncService { op.operation === 'update' && (op.data !== undefined || op.description !== undefined) ) { - // @ts-ignore // We know that at least one of the two arguments is not undefined. - acc[itemId] = {value: op.data, description: op.description}; + acc[itemId] = {value: op.data!, description: op.description!}; } return acc; diff --git a/packages/js/core/src/exports/aiContext/tasksService.ts b/packages/js/core/src/exports/aiContext/tasksService.ts index 05a2a92b..ae71887f 100644 --- a/packages/js/core/src/exports/aiContext/tasksService.ts +++ b/packages/js/core/src/exports/aiContext/tasksService.ts @@ -399,8 +399,6 @@ export class TasksService { item.operation === 'update' && (item.description !== undefined || item.paramDescriptions !== undefined) ) { - // @ts-ignore - // We know that at least one of the two arguments is not undefined. const updateData: any = {}; if (item.description !== undefined) { updateData.description = item.description; diff --git a/packages/js/core/src/logic/chat/chatRoom/chatRoom.model.ts b/packages/js/core/src/logic/chat/chatRoom/chatRoom.model.ts index efad3255..9ce79676 100644 --- a/packages/js/core/src/logic/chat/chatRoom/chatRoom.model.ts +++ b/packages/js/core/src/logic/chat/chatRoom/chatRoom.model.ts @@ -23,8 +23,8 @@ export class CompChatRoom extends BaseComp< AiMsg, CompChatRoomProps, CompChatRoomElements, CompChatRoomEvents, CompChatRoomActions > { private autoScrollController: AutoScrollController | undefined; - private conversation: CompConversation; - private promptBoxInstance: CompPromptBox; + private conversation!: CompConversation; + private promptBoxInstance!: CompPromptBox; private promptBoxText: string = ''; constructor(context: ControllerContext, { @@ -68,7 +68,6 @@ export class CompChatRoom extends BaseComp< promptBox?.submitShortcut, ); - // @ts-ignore if (!this.conversation || !this.promptBoxInstance) { throw new Error('Conversation is not initialized'); } diff --git a/packages/js/langchain/rollup.config.ts b/packages/js/langchain/rollup.config.ts index 1acaf0dc..196dfb1b 100644 --- a/packages/js/langchain/rollup.config.ts +++ b/packages/js/langchain/rollup.config.ts @@ -5,7 +5,6 @@ import strip from '@rollup/plugin-strip'; import terser from '@rollup/plugin-terser'; import {RollupOptions} from 'rollup'; import esbuild from 'rollup-plugin-esbuild'; -// @ts-ignore import {generateDts} from '../../../pipeline/utils/rollup/generateDts'; import {generateOutputConfig} from '../../../pipeline/utils/rollup/generateOutputConfig'; diff --git a/packages/js/nlbridge/rollup.config.ts b/packages/js/nlbridge/rollup.config.ts index 183a3e22..51539527 100644 --- a/packages/js/nlbridge/rollup.config.ts +++ b/packages/js/nlbridge/rollup.config.ts @@ -5,7 +5,6 @@ import strip from '@rollup/plugin-strip'; import terser from '@rollup/plugin-terser'; import {RollupOptions} from 'rollup'; import esbuild from 'rollup-plugin-esbuild'; -// @ts-ignore import {generateDts} from '../../../pipeline/utils/rollup/generateDts'; import {generateOutputConfig} from '../../../pipeline/utils/rollup/generateOutputConfig';