From b26a7f7cf37da9068813b92a8bcd8fa496dfa3e2 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Sat, 9 Dec 2023 01:52:09 +0800 Subject: [PATCH] refactor(tabby-ui): add unused-imports lint (#993) --- .github/workflows/autofix-tabby-ui.yml | 4 ++++ ee/tabby-ui/.eslintrc.json | 3 ++- .../app/(dashboard)/components/sidebar.tsx | 2 +- .../app/(dashboard)/components/worker-card.tsx | 2 +- ee/tabby-ui/app/(dashboard)/layout.tsx | 2 +- ee/tabby-ui/app/(dashboard)/page.tsx | 4 ++-- ee/tabby-ui/app/auth/layout.tsx | 2 +- .../app/auth/signin/components/signin.tsx | 2 +- .../app/auth/signup/components/signup.tsx | 2 +- .../app/playground/components/chat-sessions.tsx | 3 +-- .../components/edit-chat-title-dialog.tsx | 2 +- ee/tabby-ui/app/playground/page.tsx | 2 +- ee/tabby-ui/components/chat-panel.tsx | 4 ++-- ee/tabby-ui/components/header.tsx | 2 +- ee/tabby-ui/components/prompt-form.tsx | 12 ++++++------ ee/tabby-ui/components/ui/combobox.tsx | 2 +- ee/tabby-ui/components/ui/select.tsx | 6 +----- ee/tabby-ui/components/user-panel.tsx | 2 +- ee/tabby-ui/lib/hooks/use-health.tsx | 2 +- ee/tabby-ui/lib/hooks/use-workers.ts | 2 +- ee/tabby-ui/package.json | 2 +- ee/tabby-ui/yarn.lock | 17 ++++++++++++----- 22 files changed, 44 insertions(+), 37 deletions(-) diff --git a/.github/workflows/autofix-tabby-ui.yml b/.github/workflows/autofix-tabby-ui.yml index fc5295bf91ed..227187540e5c 100644 --- a/.github/workflows/autofix-tabby-ui.yml +++ b/.github/workflows/autofix-tabby-ui.yml @@ -35,6 +35,10 @@ jobs: working-directory: ./ee/tabby-ui run: yarn install + - name: Lint + working-directory: ./ee/tabby-ui + run: yarn lint:fix + - name: Format working-directory: ./ee/tabby-ui run: yarn format:write diff --git a/ee/tabby-ui/.eslintrc.json b/ee/tabby-ui/.eslintrc.json index 6ec5479fec08..c96e55738033 100644 --- a/ee/tabby-ui/.eslintrc.json +++ b/ee/tabby-ui/.eslintrc.json @@ -6,8 +6,9 @@ "prettier", "plugin:tailwindcss/recommended" ], - "plugins": ["tailwindcss"], + "plugins": ["tailwindcss", "unused-imports"], "rules": { + "unused-imports/no-unused-imports": "error", "tailwindcss/no-custom-classname": "off" }, "settings": { diff --git a/ee/tabby-ui/app/(dashboard)/components/sidebar.tsx b/ee/tabby-ui/app/(dashboard)/components/sidebar.tsx index d1603bdb44d9..9d02dfeff718 100644 --- a/ee/tabby-ui/app/(dashboard)/components/sidebar.tsx +++ b/ee/tabby-ui/app/(dashboard)/components/sidebar.tsx @@ -18,7 +18,7 @@ export default function Sidebar({ children, className }: SidebarProps) { className={cn('grid overflow-hidden lg:grid-cols-[280px_1fr]', className)} >
-
+