refactor: 优化eslint配置,提升代码质量 (#1341)

* feat: 统一并标准化eslint

* lint: napcat.webui

* lint: napcat.webui

* lint: napcat.core

* build: fix

* lint: napcat.webui

* refactor: 重构eslint

* Update README.md
This commit is contained in:
时瑾 authored and GitHub committed 2025-11-03 16:30:45 +08:00
1 parent d5b8f886d6
commit 06f6a542f5
651 files changed
+37978 -37584

No files matched your search

@@ -1,28 +1,28 @@
import { Button } from '@heroui/button'
import clsx from 'clsx'
import { motion } from 'motion/react'
import { useEffect, useRef, useState } from 'react'
import { TbSquareRoundedChevronLeftFilled } from 'react-icons/tb'
import { Button } from '@heroui/button';
import clsx from 'clsx';
import { motion } from 'motion/react';
import { useEffect, useRef, useState } from 'react';
import { TbSquareRoundedChevronLeftFilled } from 'react-icons/tb';
import oneBotHttpApi from '@/const/ob_api'
import type { OneBotHttpApi } from '@/const/ob_api'
import oneBotHttpApi from '@/const/ob_api';
import type { OneBotHttpApi } from '@/const/ob_api';
import OneBotApiDebug from '@/components/onebot/api/debug'
import OneBotApiNavList from '@/components/onebot/api/nav_list'
import OneBotApiDebug from '@/components/onebot/api/debug';
import OneBotApiNavList from '@/components/onebot/api/nav_list';
export default function HttpDebug() {
export default function HttpDebug () {
const [selectedApi, setSelectedApi] =
useState<keyof OneBotHttpApi>('/set_qq_profile')
const data = oneBotHttpApi[selectedApi]
const contentRef = useRef<HTMLDivElement>(null)
const [openSideBar, setOpenSideBar] = useState(true)
useState<keyof OneBotHttpApi>('/set_qq_profile');
const data = oneBotHttpApi[selectedApi];
const contentRef = useRef<HTMLDivElement>(null);
const [openSideBar, setOpenSideBar] = useState(true);
useEffect(() => {
contentRef?.current?.scrollTo?.({
top: 0,
behavior: 'smooth'
})
}, [selectedApi])
behavior: 'smooth',
});
}, [selectedApi]);
return (
<>
@@ -33,18 +33,18 @@ export default function HttpDebug() {
onSelect={setSelectedApi}
openSideBar={openSideBar}
/>
<div ref={contentRef} className="flex-1 h-full overflow-x-hidden">
<div ref={contentRef} className='flex-1 h-full overflow-x-hidden'>
<motion.div
className="absolute top-16 z-30 md:!ml-4"
className='absolute top-16 z-30 md:!ml-4'
animate={{ marginLeft: openSideBar ? '16rem' : '1rem' }}
transition={{ type: 'spring', stiffness: 150, damping: 15 }}
>
<Button
isIconOnly
color="primary"
radius="md"
variant="shadow"
size="sm"
color='primary'
radius='md'
variant='shadow'
size='sm'
onPress={() => setOpenSideBar(!openSideBar)}
>
<TbSquareRoundedChevronLeftFilled
@@ -59,5 +59,5 @@ export default function HttpDebug() {
<OneBotApiDebug path={selectedApi} data={data} />
</div>
</>
)
);
}