diff --git a/app/components/chat/AssistantMessage.tsx b/app/components/chat/AssistantMessage.tsx index e7da9ae8..b549ce44 100644 --- a/app/components/chat/AssistantMessage.tsx +++ b/app/components/chat/AssistantMessage.tsx @@ -1,8 +1,6 @@ import { memo } from 'react'; import { Markdown } from './Markdown'; import type { JSONValue } from 'ai'; -import type { ContentBlockParam } from '@anthropic-ai/sdk/resources/messages/messages.mjs'; -import { toast } from 'react-toastify'; interface AssistantMessageProps { content: string; diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index 961a6ed0..bdab52b0 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -11,8 +11,6 @@ import { Workbench } from '~/components/workbench/Workbench.client'; import { classNames } from '~/utils/classNames'; import { getLastMessageProjectContents, hasFileModifications, Messages } from './Messages.client'; import { SendButton } from './SendButton.client'; -import { APIKeyManager } from './APIKeyManager'; -import Cookies from 'js-cookie'; import * as Tooltip from '@radix-ui/react-tooltip'; import styles from './BaseChat.module.scss'; @@ -22,10 +20,8 @@ import { ExamplePrompts } from '~/components/chat/ExamplePrompts'; import GitCloneButton from './GitCloneButton'; import FilePreview from './FilePreview'; -import { ModelSelector } from '~/components/chat/ModelSelector'; import { SpeechRecognitionButton } from '~/components/chat/SpeechRecognition'; import { ScreenshotStateManager } from './ScreenshotStateManager'; -import { toast } from 'react-toastify'; import type { RejectChangeData } from './ApproveChange'; import { assert } from '~/lib/replay/ReplayProtocolClient'; import ApproveChange from './ApproveChange'; @@ -70,11 +66,10 @@ export const BaseChat = React.forwardRef( chatStarted = false, isStreaming = false, input = '', - enhancingPrompt, + _enhancingPrompt, handleInputChange, - // promptEnhanced, - enhancePrompt, + _enhancePrompt, sendMessage, handleStop, importChat, diff --git a/app/components/chat/Chat.client.tsx b/app/components/chat/Chat.client.tsx index 25ebd2e5..57ed9d6c 100644 --- a/app/components/chat/Chat.client.tsx +++ b/app/components/chat/Chat.client.tsx @@ -3,9 +3,9 @@ * Preventing TS checks with files presented in the video for a better presentation. */ import { useStore } from '@nanostores/react'; -import type { CreateMessage, Message } from 'ai'; +import type { Message } from 'ai'; import { useAnimate } from 'framer-motion'; -import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { memo, useCallback, useEffect, useRef, useState } from 'react'; import { cssTransition, toast, ToastContainer } from 'react-toastify'; import { useMessageParser, useShortcuts, useSnapScroll } from '~/lib/hooks'; import { description, useChatHistory } from '~/lib/persistence'; @@ -13,11 +13,10 @@ import { chatStore } from '~/lib/stores/chat'; import { workbenchStore } from '~/lib/stores/workbench'; import { PROMPT_COOKIE_KEY } from '~/utils/constants'; import { cubicEasingFn } from '~/utils/easings'; -import { createScopedLogger, renderLogger } from '~/utils/logger'; +import { renderLogger } from '~/utils/logger'; import { BaseChat } from './BaseChat'; import Cookies from 'js-cookie'; import { debounce } from '~/utils/debounce'; -import { useSettings } from '~/lib/hooks/useSettings'; import { useSearchParams } from '@remix-run/react'; import { createSampler } from '~/utils/sampler'; import { saveProjectContents } from './Messages.client'; @@ -28,26 +27,20 @@ import { simulationRepositoryUpdated, shouldUseSimulation, sendDeveloperChatMessage, - type ProtocolMessage, } from '~/lib/replay/SimulationPrompt'; import { getIFrameSimulationData } from '~/lib/replay/Recording'; import { getCurrentIFrame } from '~/components/workbench/Preview'; import { getCurrentMouseData } from '~/components/workbench/PointSelector'; import { anthropicNumFreeUsesCookieName, anthropicApiKeyCookieName, MaxFreeUses } from '~/utils/freeUses'; -import type { FileMap } from '~/lib/stores/files'; -import { shouldIncludeFile } from '~/utils/fileUtils'; import { getNutLoginKey, submitFeedback } from '~/lib/replay/Problems'; import { ChatMessageTelemetry, pingTelemetry } from '~/lib/hooks/pingTelemetry'; import type { RejectChangeData } from './ApproveChange'; -import { assert, generateRandomId } from '~/lib/replay/ReplayProtocolClient'; +import { generateRandomId } from '~/lib/replay/ReplayProtocolClient'; const toastAnimation = cssTransition({ enter: 'animated fadeInRight', exit: 'animated fadeOutRight', }); - -const logger = createScopedLogger('Chat'); - let gLastProjectContents: string | undefined; export function getLastProjectContents() { diff --git a/app/components/chat/LoadProblemButton.tsx b/app/components/chat/LoadProblemButton.tsx index cb5ad2f0..29a88a05 100644 --- a/app/components/chat/LoadProblemButton.tsx +++ b/app/components/chat/LoadProblemButton.tsx @@ -93,7 +93,7 @@ export const LoadProblemButton: React.FC = ({ className, const [isLoading, setIsLoading] = useState(false); const [isInputOpen, setIsInputOpen] = useState(false); - const handleSubmit = async (e: React.ChangeEvent) => { + const handleSubmit = async (_e: React.ChangeEvent) => { setIsLoading(true); setIsInputOpen(false); @@ -112,7 +112,7 @@ export const LoadProblemButton: React.FC = ({ className, type="text" webkitdirectory="" directory="" - onChange={() => {}} + onChange={(_e) => {}} onKeyDown={(e) => { if (e.key === 'Enter') { handleSubmit(e as any); diff --git a/app/components/settings/features/FeaturesTab.tsx b/app/components/settings/features/FeaturesTab.tsx index f0c6ba78..f9397a8b 100644 --- a/app/components/settings/features/FeaturesTab.tsx +++ b/app/components/settings/features/FeaturesTab.tsx @@ -11,8 +11,10 @@ export default function FeaturesTab() { enableEventLogs, isLatestBranch, enableLatestBranch, - promptId, - setPromptId, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _promptId: promptId, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _setPromptId: setPromptId, autoSelectTemplate, setAutoSelectTemplate, enableContextOptimization, diff --git a/app/components/settings/providers/APIKeysTab.tsx b/app/components/settings/providers/APIKeysTab.tsx index b8981f5f..17a6180a 100644 --- a/app/components/settings/providers/APIKeysTab.tsx +++ b/app/components/settings/providers/APIKeysTab.tsx @@ -31,7 +31,7 @@ export default function ConnectionsTab() { try { await saveNutLoginKey(key); toast.success('Login key saved'); - } catch (error) { + } catch { toast.error('Failed to save login key'); } }; diff --git a/app/lib/.server/otel.ts b/app/lib/.server/otel.ts index eda71de2..75b360e8 100644 --- a/app/lib/.server/otel.ts +++ b/app/lib/.server/otel.ts @@ -2,7 +2,7 @@ import type { Tracer } from '@opentelemetry/api'; import { SpanStatusCode, type Attributes, context, trace } from '@opentelemetry/api'; import type { ExportResult } from '@opentelemetry/core'; import { ExportResultCode } from '@opentelemetry/core'; -import type { ExportServiceError, OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base'; +import type { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base'; import { OTLPExporterError } from '@opentelemetry/otlp-exporter-base'; import { createExportTraceServiceRequest } from '@opentelemetry/otlp-transformer'; import { Resource } from '@opentelemetry/resources'; diff --git a/app/lib/replay/Recording.ts b/app/lib/replay/Recording.ts index 06d28b1e..d2899266 100644 --- a/app/lib/replay/Recording.ts +++ b/app/lib/replay/Recording.ts @@ -87,7 +87,7 @@ export async function getMouseData(iframe: HTMLIFrameElement, position: { x: num } // Add handlers to the current iframe's window. -function addRecordingMessageHandler(messageHandlerId: string) { +function addRecordingMessageHandler(_messageHandlerId: string) { const simulationData: SimulationData = []; let numSimulationPacketsSent = 0; @@ -342,7 +342,7 @@ function addRecordingMessageHandler(messageHandlerId: string) { { capture: true, passive: true }, ); - function onInterceptedOperation(name: string) { + function onInterceptedOperation(_name: string) { //console.log(`InterceptedOperation ${name}`); } diff --git a/app/lib/replay/ReplayProtocolClient.ts b/app/lib/replay/ReplayProtocolClient.ts index e9cb1ae1..73a602a7 100644 --- a/app/lib/replay/ReplayProtocolClient.ts +++ b/app/lib/replay/ReplayProtocolClient.ts @@ -43,7 +43,7 @@ export function stringToBase64(inputString: string) { return uint8ArrayToBase64(data); } -function logDebug(msg: string, tags: Record = {}) { +function logDebug(msg: string, _tags: Record = {}) { //console.log(msg, JSON.stringify(tags)); } diff --git a/app/lib/runtime/message-parser.ts b/app/lib/runtime/message-parser.ts index e0ffd809..df3ad48b 100644 --- a/app/lib/runtime/message-parser.ts +++ b/app/lib/runtime/message-parser.ts @@ -309,6 +309,7 @@ export class StreamingMessageParser { } } +// eslint-disable-next-line @typescript-eslint/no-unused-vars const createArtifactElement: ElementFactory = (props) => { const elementProps = [ 'class="__boltArtifact__"', diff --git a/app/routes/api.ping-telemetry.ts b/app/routes/api.ping-telemetry.ts index 5d84adc3..e5940fda 100644 --- a/app/routes/api.ping-telemetry.ts +++ b/app/routes/api.ping-telemetry.ts @@ -28,7 +28,7 @@ export async function action(args: ActionFunctionArgs) { return pingTelemetryAction(args); } -async function pingTelemetryAction({ context, request }: ActionFunctionArgs) { +async function pingTelemetryAction({ request }: ActionFunctionArgs) { const { event, data } = await request.json<{ event: string; data: any;