chore: pnpm lint fix

ran pnpm lint fix and fixed all lint errors
This commit is contained in:
Dustin Loring
2025-01-16 10:45:06 -05:00
parent d55a584013
commit 0bf3cafe83
35 changed files with 116 additions and 97 deletions

View File

@@ -1,15 +1,14 @@
import type { Message } from 'ai';
import React, { type RefCallback } from 'react';
import { ClientOnly } from 'remix-utils/client-only';
import styles from './BaseChat.module.scss';
import FilePreview from './FilePreview';
import { Messages } from './Messages.client';
import { SendButton } from './SendButton.client';
import { Menu } from '~/components/sidebar/Menu.client';
import { IconButton } from '~/components/ui/IconButton';
import { Workbench } from '~/components/workbench/Workbench.client';
import { classNames } from '~/utils/classNames';
import { Messages } from './Messages.client';
import { SendButton } from './SendButton.client';
import FilePreview from './FilePreview';
import styles from './BaseChat.module.scss';
interface BaseChatProps {
textareaRef?: React.RefObject<HTMLTextAreaElement> | undefined;
@@ -208,7 +207,12 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
<FilePreview
files={files}
imageDataList={imageDataList || []}
onRemove={onRemoveFile || (() => {})}
onRemove={
onRemoveFile ||
function noop() {
/* no-op */
}
}
/>
</div>
)}

View File

@@ -4,6 +4,7 @@ import { useChat } from 'ai/react';
import { useAnimate } from 'framer-motion';
import { memo, useEffect, useRef, useState } from 'react';
import { cssTransition, toast, ToastContainer } from 'react-toastify';
import { BaseChat } from './BaseChat';
import { useMessageParser, usePromptEnhancer, useShortcuts, useSnapScroll } from '~/lib/hooks';
import { useChatHistory } from '~/lib/persistence';
import { chatStore } from '~/lib/stores/chat';
@@ -11,7 +12,6 @@ import { workbenchStore } from '~/lib/stores/workbench';
import { fileModificationsToHTML } from '~/utils/diff';
import { cubicEasingFn } from '~/utils/easings';
import { createScopedLogger, renderLogger } from '~/utils/logger';
import { BaseChat } from './BaseChat';
const toastAnimation = cssTransition({
enter: 'animated fadeInRight',
@@ -151,9 +151,10 @@ export const ChatImpl = memo(({ initialMessages, storeMessageHistory }: ChatProp
const handleFileUpload = (fileList: FileList) => {
const newFiles = Array.from(fileList);
setFiles((prevFiles) => [...prevFiles, ...newFiles]);
newFiles.forEach((file) => {
const reader = new FileReader();
reader.onloadend = () => {
setImageDataList((prev) => [...prev, reader.result as string]);
};

View File

@@ -1,10 +1,9 @@
import { memo, useEffect, useState } from 'react';
import { bundledLanguages, codeToHtml, isSpecialLang, type BundledLanguage, type SpecialLanguage } from 'shiki';
import styles from './CodeBlock.module.scss';
import { classNames } from '~/utils/classNames';
import { createScopedLogger } from '~/utils/logger';
import styles from './CodeBlock.module.scss';
const logger = createScopedLogger('CodeBlock');
interface CodeBlockProps {

View File

@@ -32,4 +32,4 @@ const FilePreview: React.FC<FilePreviewProps> = ({ files, imageDataList, onRemov
);
};
export default FilePreview;
export default FilePreview;

View File

@@ -1,12 +1,12 @@
import { memo, useMemo } from 'react';
import ReactMarkdown, { type Components } from 'react-markdown';
import type { BundledLanguage } from 'shiki';
import { createScopedLogger } from '~/utils/logger';
import { rehypePlugins, remarkPlugins, allowedHTMLElements } from '~/utils/markdown';
import { Artifact } from './Artifact';
import { CodeBlock } from './CodeBlock';
import styles from './Markdown.module.scss';
import { createScopedLogger } from '~/utils/logger';
import { rehypePlugins, remarkPlugins, allowedHTMLElements } from '~/utils/markdown';
const logger = createScopedLogger('MarkdownComponent');

View File

@@ -1,8 +1,8 @@
import type { Message } from 'ai';
import React from 'react';
import { classNames } from '~/utils/classNames';
import { AssistantMessage } from './AssistantMessage';
import { UserMessage } from './UserMessage';
import { classNames } from '~/utils/classNames';
interface MessagesProps {
id?: string;

View File

@@ -1,5 +1,5 @@
import { modificationsRegex } from '~/utils/diff';
import { Markdown } from './Markdown';
import { modificationsRegex } from '~/utils/diff';
interface MessageContent {
type: string;
@@ -18,7 +18,11 @@ export function UserMessage({ content }: UserMessageProps) {
<div className="flex flex-col gap-4">
{content.map((item, index) => {
if (item.type === 'text') {
return <Markdown key={index} limitedMarkdown>{sanitizeUserMessage(item.text || '')}</Markdown>;
return (
<Markdown key={index} limitedMarkdown>
{sanitizeUserMessage(item.text || '')}
</Markdown>
);
} else if (item.type === 'image') {
return (
<div key={index} className="max-w-[300px]">
@@ -26,6 +30,7 @@ export function UserMessage({ content }: UserMessageProps) {
</div>
);
}
return null;
})}
</div>