From c648dc5208ccd9e543ec481b1ef4a5bc13c414d3 Mon Sep 17 00:00:00 2001 From: Ben <4991309+NuroDev@users.noreply.github.com> Date: Wed, 11 Mar 2026 15:48:10 +0000 Subject: [PATCH 1/3] chore(local-explorer-ui): Add TailwindCSS ESLint & Prettier plugins (#12819) Co-authored-by: emily-shen <69125074+emily-shen@users.noreply.github.com> --- .prettierrc | 10 +- package.json | 1 + packages/local-explorer-ui/eslint.config.mjs | 13 ++ packages/local-explorer-ui/package.json | 1 + .../src/components/AddKVForm.tsx | 14 +- .../src/components/Breadcrumbs.tsx | 4 +- .../src/components/CopyButton.tsx | 4 +- .../src/components/KVTable.tsx | 45 +++-- .../src/components/SearchForm.tsx | 6 +- .../src/components/Sidebar.tsx | 26 +-- .../src/components/studio/Code/Block.tsx | 2 +- .../studio/Explain/SQLiteExplainTab.tsx | 14 +- .../studio/Modal/CommitConfirmation.tsx | 2 +- .../studio/Modal/DeleteConfirmation.tsx | 4 +- .../studio/Modal/DropTableConfirmation.tsx | 4 +- .../studio/Modal/Export/OptionsEditor.tsx | 14 +- .../components/studio/Modal/Export/index.tsx | 10 +- .../components/studio/QueryResult/Stats.tsx | 6 +- .../components/studio/QueryResult/Summary.tsx | 6 +- .../src/components/studio/QueryResult/Tab.tsx | 6 +- .../studio/Table/ActionsDropdown.tsx | 4 +- .../src/components/studio/Table/BaseTable.tsx | 4 +- .../src/components/studio/Table/Cell.tsx | 2 +- .../components/studio/Table/HeaderList.tsx | 4 +- .../studio/Table/Result/DisplayCell.tsx | 20 +-- .../studio/Table/Result/EditableCell.tsx | 10 +- .../components/studio/Table/Result/index.tsx | 16 +- .../studio/Table/SchemaEditor/Column.tsx | 28 ++-- .../SchemaEditor/ConstraintListEditor.tsx | 18 +- .../studio/Table/SchemaEditor/index.tsx | 48 +++--- .../components/studio/Table/State/Helpers.tsx | 12 +- .../src/components/studio/Tabs/Query.tsx | 16 +- .../components/studio/Tabs/TableExplorer.tsx | 20 +-- .../components/studio/WhereFilterInput.tsx | 2 +- .../studio/WindowTab/ContentWrapper.tsx | 2 +- .../studio/WindowTab/ItemRenderer.tsx | 4 +- .../components/studio/WindowTab/MenuProps.tsx | 2 +- .../src/components/studio/WindowTab/index.tsx | 6 +- .../src/components/studio/index.tsx | 2 +- .../local-explorer-ui/src/routes/__root.tsx | 2 +- .../src/routes/d1/$databaseId.tsx | 22 +-- .../src/routes/do/$className/$objectId.tsx | 22 +-- .../src/routes/do/$className/index.tsx | 20 +-- .../local-explorer-ui/src/routes/index.tsx | 6 +- .../src/routes/kv/$namespaceId.tsx | 40 ++--- .../local-explorer-ui/src/styles/tailwind.css | 2 +- pnpm-lock.yaml | 158 ++++++++++++++---- 47 files changed, 400 insertions(+), 284 deletions(-) diff --git a/.prettierrc b/.prettierrc index cc051c14b0bd..7b5461baa175 100644 --- a/.prettierrc +++ b/.prettierrc @@ -6,7 +6,8 @@ "trailingComma": "es5", "plugins": [ "@ianvs/prettier-plugin-sort-imports", - "prettier-plugin-packagejson" + "prettier-plugin-packagejson", + "prettier-plugin-tailwindcss" ], "overrides": [ { @@ -53,6 +54,13 @@ "options": { "proseWrap": "never" } + }, + { + "files": "packages/local-explorer-ui/**/*.{js,jsx,ts,tsx}", + "options": { + "tailwindStylesheet": "./packages/local-explorer-ui/src/styles/tailwind.css", + "tailwindFunctions": ["cn"] + } } ] } diff --git a/package.json b/package.json index 31cae1ca62a4..7863800a14aa 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "jsonc-parser": "catalog:default", "prettier": "^3.2.5", "prettier-plugin-packagejson": "^2.2.18", + "prettier-plugin-tailwindcss": "^0.7.2", "tree-kill": "^1.2.2", "turbo": "^2.7.2", "typescript": "catalog:default", diff --git a/packages/local-explorer-ui/eslint.config.mjs b/packages/local-explorer-ui/eslint.config.mjs index 5cd441d044d1..95e0a0454d7d 100644 --- a/packages/local-explorer-ui/eslint.config.mjs +++ b/packages/local-explorer-ui/eslint.config.mjs @@ -1,4 +1,7 @@ +import { dirname } from "node:path"; +import { fileURLToPath } from "node:url"; import sharedConfig from "@cloudflare/eslint-config-shared/react"; +import tailwind from "eslint-plugin-tailwindcss"; import { defineConfig } from "eslint/config"; export default defineConfig([ @@ -6,4 +9,14 @@ export default defineConfig([ ignores: ["src/api/generated/**", "src/routeTree.gen.ts"], }, sharedConfig, + ...tailwind.configs["flat/recommended"], + { + settings: { + tailwindcss: { + callees: ["cn"], + config: + dirname(fileURLToPath(import.meta.url)) + "/src/styles/tailwind.css", + }, + }, + }, ]); diff --git a/packages/local-explorer-ui/package.json b/packages/local-explorer-ui/package.json index c17e145d182f..3dbb098284d9 100644 --- a/packages/local-explorer-ui/package.json +++ b/packages/local-explorer-ui/package.json @@ -51,6 +51,7 @@ "@types/react-dom": "^19.2.0", "@vitejs/plugin-react": "^4.4.1", "concurrently": "^9.0.0", + "eslint-plugin-tailwindcss": "^4.0.0-beta.0", "typescript": "catalog:default", "vite": "catalog:default", "vite-plugin-svgr": "^4.3.0", diff --git a/packages/local-explorer-ui/src/components/AddKVForm.tsx b/packages/local-explorer-ui/src/components/AddKVForm.tsx index f42555ffc86e..d001158d0349 100644 --- a/packages/local-explorer-ui/src/components/AddKVForm.tsx +++ b/packages/local-explorer-ui/src/components/AddKVForm.tsx @@ -54,17 +54,17 @@ export function AddKVForm({ onAdd, clearSignal = 0 }: AddKVFormProps) { return (
-
+
{keyError && ( - {keyError} + {keyError} )}
-
+