From f10cc6d8a5a29c85a1365d921a79f91f63538e2e Mon Sep 17 00:00:00 2001 From: yuri-sakharov <10849682+yuri-sakharov@users.noreply.github.com> Date: Sun, 30 Nov 2025 22:11:52 +0200 Subject: [PATCH] Added prettier-plugin-tailwindcss and sorted the classes + some small fixes (#630) * Added prettier-plugin-tailwindcss and sorted the classes * Added tsc into staged check + some type improvements --- frontend/.prettierrc.yaml | 3 + frontend/package-lock.json | 80 +++++++++++++++++++ frontend/package.json | 4 +- frontend/src/App.tsx | 4 +- frontend/src/components/Button.tsx | 2 +- frontend/src/components/ClustersList.tsx | 12 +-- .../InstalledPackages/HealthStatus.tsx | 2 +- .../InstalledPackageCard.tsx | 20 ++--- .../InstalledPackagesHeader.tsx | 12 +-- frontend/src/components/SelectMenu.tsx | 2 +- frontend/src/components/ShutDownButton.tsx | 4 +- frontend/src/components/Spinner/index.tsx | 2 +- frontend/src/components/Tabs.tsx | 10 +-- frontend/src/components/TabsBar.stories.tsx | 6 +- frontend/src/components/TextInput.tsx | 4 +- frontend/src/components/Tooltip.tsx | 6 +- frontend/src/components/Troubleshoot.tsx | 2 +- frontend/src/components/common/DropDown.tsx | 12 +-- .../src/components/common/StatusLabel.tsx | 2 +- .../components/modal/AddRepositoryModal.tsx | 18 ++--- frontend/src/components/modal/ErrorModal.tsx | 8 +- .../src/components/modal/GlobalErrorModal.tsx | 4 +- .../modal/InstallChartModal/ChartValues.tsx | 4 +- .../modal/InstallChartModal/DefinedValues.tsx | 2 +- .../InstallReleaseChartModal.tsx | 2 +- .../InstallRepoChartModal.tsx | 2 +- .../InstallChartModal/InstallUpgradeTitle.tsx | 2 +- .../modal/InstallChartModal/ManifestDiff.tsx | 4 +- .../InstallChartModal/UserDefinedValues.tsx | 6 +- .../InstallChartModal/VersionToInstall.tsx | 14 ++-- frontend/src/components/modal/Modal.tsx | 18 ++--- .../src/components/repository/ChartViewer.tsx | 6 +- .../repository/RepositoriesList.tsx | 6 +- .../repository/RepositoryViewer.tsx | 20 ++--- .../components/revision/RevisionDetails.tsx | 34 ++++---- .../src/components/revision/RevisionDiff.tsx | 18 ++--- .../components/revision/RevisionResource.tsx | 38 ++++----- .../src/components/revision/RevisionsList.tsx | 6 +- frontend/src/layout/Header.tsx | 20 ++--- frontend/src/pages/Installed.tsx | 4 +- frontend/src/pages/Repository.tsx | 2 +- frontend/src/pages/Revision.tsx | 22 ++--- frontend/yarn.lock | 5 ++ 43 files changed, 271 insertions(+), 183 deletions(-) diff --git a/frontend/.prettierrc.yaml b/frontend/.prettierrc.yaml index 98eb2b2..7db5aa6 100644 --- a/frontend/.prettierrc.yaml +++ b/frontend/.prettierrc.yaml @@ -3,3 +3,6 @@ tabWidth: 2 semi: true singleQuote: false bracketSpacing: true +plugins: + - "prettier-plugin-tailwindcss" # should be last https://github.com/tailwindlabs/prettier-plugin-tailwindcss?tab=readme-ov-file#compatibility-with-other-prettier-plugins +tailwindStylesheet: "./src/index.css" \ No newline at end of file diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 5bdfe5e..baed987 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -53,6 +53,7 @@ "husky": "^9.1.7", "lint-staged": "^16.2.7", "prettier": "^3.7.1", + "prettier-plugin-tailwindcss": "^0.7.1", "storybook": "10.0.8", "tailwindcss": "^4.1.17", "typescript": "^5.9.3", @@ -10281,6 +10282,85 @@ "node": ">=6.0.0" } }, + "node_modules/prettier-plugin-tailwindcss": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.7.1.tgz", + "integrity": "sha512-Bzv1LZcuiR1Sk02iJTS1QzlFNp/o5l2p3xkopwOrbPmtMeh3fK9rVW5M3neBQzHq+kGKj/4LGQMTNcTH4NGPtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.19" + }, + "peerDependencies": { + "@ianvs/prettier-plugin-sort-imports": "*", + "@prettier/plugin-hermes": "*", + "@prettier/plugin-oxc": "*", + "@prettier/plugin-pug": "*", + "@shopify/prettier-plugin-liquid": "*", + "@trivago/prettier-plugin-sort-imports": "*", + "@zackad/prettier-plugin-twig": "*", + "prettier": "^3.0", + "prettier-plugin-astro": "*", + "prettier-plugin-css-order": "*", + "prettier-plugin-jsdoc": "*", + "prettier-plugin-marko": "*", + "prettier-plugin-multiline-arrays": "*", + "prettier-plugin-organize-attributes": "*", + "prettier-plugin-organize-imports": "*", + "prettier-plugin-sort-imports": "*", + "prettier-plugin-svelte": "*" + }, + "peerDependenciesMeta": { + "@ianvs/prettier-plugin-sort-imports": { + "optional": true + }, + "@prettier/plugin-hermes": { + "optional": true + }, + "@prettier/plugin-oxc": { + "optional": true + }, + "@prettier/plugin-pug": { + "optional": true + }, + "@shopify/prettier-plugin-liquid": { + "optional": true + }, + "@trivago/prettier-plugin-sort-imports": { + "optional": true + }, + "@zackad/prettier-plugin-twig": { + "optional": true + }, + "prettier-plugin-astro": { + "optional": true + }, + "prettier-plugin-css-order": { + "optional": true + }, + "prettier-plugin-jsdoc": { + "optional": true + }, + "prettier-plugin-marko": { + "optional": true + }, + "prettier-plugin-multiline-arrays": { + "optional": true + }, + "prettier-plugin-organize-attributes": { + "optional": true + }, + "prettier-plugin-organize-imports": { + "optional": true + }, + "prettier-plugin-sort-imports": { + "optional": true + }, + "prettier-plugin-svelte": { + "optional": true + } + } + }, "node_modules/pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index 57987ab..2a94ee6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -49,6 +49,7 @@ "husky": "^9.1.7", "lint-staged": "^16.2.7", "prettier": "^3.7.1", + "prettier-plugin-tailwindcss": "^0.7.1", "storybook": "10.0.8", "tailwindcss": "^4.1.17", "typescript": "^5.9.3", @@ -60,7 +61,8 @@ "npm run lint:fix", "npm run prettier:fix" ], - "*.{json,css,md,mdx}": "npm run prettier:fix" + "*.{json,css,md,mdx}": "npm run prettier:fix", + "src/*.{ts,tsx}": "npm run tsc:check" }, "scripts": { "dev": "vite", diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 645cfbf..3c140f8 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -22,9 +22,9 @@ const queryClient = new QueryClient({ const PageLayout = () => { return ( -
+
-
+
diff --git a/frontend/src/components/Button.tsx b/frontend/src/components/Button.tsx index 1f37adf..30bee01 100644 --- a/frontend/src/components/Button.tsx +++ b/frontend/src/components/Button.tsx @@ -27,7 +27,7 @@ export default function Button(props: ButtonProps): JSX.Element { <> diff --git a/frontend/src/components/Spinner/index.tsx b/frontend/src/components/Spinner/index.tsx index 5879f0a..c0bbcab 100644 --- a/frontend/src/components/Spinner/index.tsx +++ b/frontend/src/components/Spinner/index.tsx @@ -3,7 +3,7 @@ export default function Spinner({ size = 8 }: { size?: number }) {
tab1
, + component:
tab1
, }, { name: "tab2", - component:
tab2
, + component:
tab2
, }, { name: "tab3", - component:
tab3
, + component:
tab3
, }, ], activeTab: "tab1", diff --git a/frontend/src/components/TextInput.tsx b/frontend/src/components/TextInput.tsx index 5876f08..528b9c2 100644 --- a/frontend/src/components/TextInput.tsx +++ b/frontend/src/components/TextInput.tsx @@ -24,7 +24,7 @@ export interface TextInputProps { export default function TextInput(props: TextInputProps): JSX.Element { return (
-
); diff --git a/frontend/src/components/Tooltip.tsx b/frontend/src/components/Tooltip.tsx index 2e701bb..d390ddd 100644 --- a/frontend/src/components/Tooltip.tsx +++ b/frontend/src/components/Tooltip.tsx @@ -20,7 +20,7 @@ export default function Tooltip({