diff --git a/.prettierrc b/.prettierrc index cc051c14b0b..7b5461baa17 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 31cae1ca62a..7863800a14a 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 5cd441d044d..95e0a0454d7 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 c17e145d182..3dbb098284d 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 f42555ffc86..d001158d034 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} )}
-
+