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

View file

@ -33,6 +33,7 @@
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.38.0", "@eslint/js": "^9.38.0",
"daisyui": "^5.4.7",
"eslint": "^9.38.0", "eslint": "^9.38.0",
"eslint-plugin-import": "^2.32.0", "eslint-plugin-import": "^2.32.0",
"eslint-plugin-react": "^7.37.5", "eslint-plugin-react": "^7.37.5",
@ -2906,6 +2907,16 @@
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
"license": "MIT" "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": { "node_modules/data-uri-to-buffer": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", "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", "packageManager": ">=npm@10.9.0",
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.38.0", "@eslint/js": "^9.38.0",
"daisyui": "^5.4.7",
"eslint": "^9.38.0", "eslint": "^9.38.0",
"eslint-plugin-import": "^2.32.0", "eslint-plugin-import": "^2.32.0",
"eslint-plugin-react": "^7.37.5", "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 ChatHeader from "src/components/ui/chat/chat-header";
import ChatWindow from "src/components/ui/chat/chat-window"; import ChatWindow from "src/components/ui/chat/chat-window";
import MessageInput from "src/components/ui/chat/message-input"; import MessageInput from "src/components/ui/chat/message-input";
@ -10,7 +16,7 @@ import {
} from "src/lib/api"; } from "src/lib/api";
const createId = () => const createId = () =>
(globalThis.crypto?.randomUUID?.() ?? `id-${Date.now()}-${Math.random()}`); globalThis.crypto?.randomUUID?.() ?? `id-${Date.now()}-${Math.random()}`;
const INTRO_MESSAGE = { const INTRO_MESSAGE = {
id: "intro", id: "intro",
@ -176,8 +182,8 @@ export default function ChatLayout() {
prev.map((message) => prev.map((message) =>
message.id === placeholderId message.id === placeholderId
? { ...message, content, pending: false } ? { ...message, content, pending: false }
: message : message,
) ),
); );
} catch (error) { } catch (error) {
const message = error?.message || "Something went wrong."; const message = error?.message || "Something went wrong.";
@ -190,8 +196,8 @@ export default function ChatLayout() {
pending: false, pending: false,
error: true, error: true,
} }
: entry : entry,
) ),
); );
showError(message); showError(message);
} finally { } finally {
@ -206,7 +212,7 @@ export default function ChatLayout() {
refreshFiles, refreshFiles,
waitForResult, waitForResult,
buildAssistantMarkdown, buildAssistantMarkdown,
] ],
); );
const handleDeleteAll = useCallback(() => { const handleDeleteAll = useCallback(() => {

View file

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