feat(daisyui): added that and fixed eslint
Some checks failed
Build and Deploy / Build Images and Deploy to Server (push) Has been cancelled

jeez theres a lot of garbage code in here
This commit is contained in:
JK-le-dev 2025-11-07 11:26:36 -06:00
commit d8d57edd84
5 changed files with 48 additions and 23 deletions

View file

@ -1,18 +1,15 @@
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks"; // Or import { configs as reactHooks } from "eslint-plugin-react-hooks";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import { defineConfig, globalIgnores } from "eslint/config";
export default defineConfig([
globalIgnores(["dist"]),
export default [
{
files: ["**/*{js,jsx}"],
extends: [
ignores: ["dist/**"],
},
js.configs.recommended,
reactHooks.configs["recommended-latest"],
reactRefresh.configs.vite,
],
{
files: ["**/*.{js,jsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
@ -22,8 +19,17 @@ export default defineConfig([
sourceType: "module",
},
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"no-unused-vars": ["error", { varsIgnorePattern: "^[A-Z_]" }],
},
},
]);
];

View file

@ -33,6 +33,7 @@
},
"devDependencies": {
"@eslint/js": "^9.38.0",
"daisyui": "^5.4.7",
"eslint": "^9.38.0",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-react": "^7.37.5",
@ -2906,6 +2907,16 @@
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
"license": "MIT"
},
"node_modules/daisyui": {
"version": "5.4.7",
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-5.4.7.tgz",
"integrity": "sha512-2wYO61vTPCXk7xEBgnzLZAYoE0xS5IRLu/GSq0vORpB+cTrtubdx69NnA0loc0exvCY1s2fYL4lGZtFHe2ohNQ==",
"dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/saadeghi/daisyui?sponsor=1"
}
},
"node_modules/data-uri-to-buffer": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",

View file

@ -40,6 +40,7 @@
"packageManager": ">=npm@10.9.0",
"devDependencies": {
"@eslint/js": "^9.38.0",
"daisyui": "^5.4.7",
"eslint": "^9.38.0",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-react": "^7.37.5",

View file

@ -1,4 +1,10 @@
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
import React, {
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from "react";
import ChatHeader from "src/components/ui/chat/chat-header";
import ChatWindow from "src/components/ui/chat/chat-window";
import MessageInput from "src/components/ui/chat/message-input";
@ -10,7 +16,7 @@ import {
} from "src/lib/api";
const createId = () =>
(globalThis.crypto?.randomUUID?.() ?? `id-${Date.now()}-${Math.random()}`);
globalThis.crypto?.randomUUID?.() ?? `id-${Date.now()}-${Math.random()}`;
const INTRO_MESSAGE = {
id: "intro",
@ -176,8 +182,8 @@ export default function ChatLayout() {
prev.map((message) =>
message.id === placeholderId
? { ...message, content, pending: false }
: message
)
: message,
),
);
} catch (error) {
const message = error?.message || "Something went wrong.";
@ -190,8 +196,8 @@ export default function ChatLayout() {
pending: false,
error: true,
}
: entry
)
: entry,
),
);
showError(message);
} finally {
@ -206,7 +212,7 @@ export default function ChatLayout() {
refreshFiles,
waitForResult,
buildAssistantMarkdown,
]
],
);
const handleDeleteAll = useCallback(() => {

View file

@ -1,4 +1,5 @@
@import "tailwindcss";
@import "daisyui";
.dark {
--paragraph: 235, 236, 239;