mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
Remove unused variables
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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<HTMLDivElement, BaseChatProps>(
|
||||
chatStarted = false,
|
||||
isStreaming = false,
|
||||
input = '',
|
||||
enhancingPrompt,
|
||||
_enhancingPrompt,
|
||||
handleInputChange,
|
||||
|
||||
// promptEnhanced,
|
||||
enhancePrompt,
|
||||
_enhancePrompt,
|
||||
sendMessage,
|
||||
handleStop,
|
||||
importChat,
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -93,7 +93,7 @@ export const LoadProblemButton: React.FC<LoadProblemButtonProps> = ({ className,
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [isInputOpen, setIsInputOpen] = useState(false);
|
||||
|
||||
const handleSubmit = async (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const handleSubmit = async (_e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setIsLoading(true);
|
||||
setIsInputOpen(false);
|
||||
|
||||
@@ -112,7 +112,7 @@ export const LoadProblemButton: React.FC<LoadProblemButtonProps> = ({ className,
|
||||
type="text"
|
||||
webkitdirectory=""
|
||||
directory=""
|
||||
onChange={() => {}}
|
||||
onChange={(_e) => {}}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
handleSubmit(e as any);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ export function stringToBase64(inputString: string) {
|
||||
return uint8ArrayToBase64(data);
|
||||
}
|
||||
|
||||
function logDebug(msg: string, tags: Record<string, any> = {}) {
|
||||
function logDebug(msg: string, _tags: Record<string, any> = {}) {
|
||||
//console.log(msg, JSON.stringify(tags));
|
||||
}
|
||||
|
||||
|
||||
@@ -309,6 +309,7 @@ export class StreamingMessageParser {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const createArtifactElement: ElementFactory = (props) => {
|
||||
const elementProps = [
|
||||
'class="__boltArtifact__"',
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user