Skip to content

Commit

Permalink
Fixed some @ts-ignore comments
Browse files Browse the repository at this point in the history
  • Loading branch information
salmenus committed May 11, 2024
1 parent 10b8df7 commit f5de8ac
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 13 deletions.
1 change: 1 addition & 0 deletions packages/css/themes/modules.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'postcss-csso';
2 changes: 0 additions & 2 deletions packages/css/themes/rollup.config.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 1 addition & 0 deletions packages/extra/highlighter/modules.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'postcss-csso';
1 change: 0 additions & 1 deletion packages/extra/highlighter/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
1 change: 0 additions & 1 deletion packages/js/core/src/exports/aiContext/aiContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions packages/js/core/src/exports/aiContext/dataSyncService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions packages/js/core/src/exports/aiContext/tasksService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions packages/js/core/src/logic/chat/chatRoom/chatRoom.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export class CompChatRoom<AiMsg> extends BaseComp<
AiMsg, CompChatRoomProps<AiMsg>, CompChatRoomElements, CompChatRoomEvents, CompChatRoomActions
> {
private autoScrollController: AutoScrollController | undefined;
private conversation: CompConversation<AiMsg>;
private promptBoxInstance: CompPromptBox<AiMsg>;
private conversation!: CompConversation<AiMsg>;
private promptBoxInstance!: CompPromptBox<AiMsg>;
private promptBoxText: string = '';

constructor(context: ControllerContext<AiMsg>, {
Expand Down Expand Up @@ -68,7 +68,6 @@ export class CompChatRoom<AiMsg> extends BaseComp<
promptBox?.submitShortcut,
);

// @ts-ignore
if (!this.conversation || !this.promptBoxInstance) {
throw new Error('Conversation is not initialized');
}
Expand Down
1 change: 0 additions & 1 deletion packages/js/langchain/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
1 change: 0 additions & 1 deletion packages/js/nlbridge/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down

0 comments on commit f5de8ac

Please sign in to comment.