From 7f0a47dcc9be8e0cb977c6d78f5e7e5de6d6bae9 Mon Sep 17 00:00:00 2001 From: Claas Date: Thu, 23 May 2024 12:26:27 +0200 Subject: [PATCH] Configure prettier to consistently sort classes --- package.json | 2 ++ pnpm-lock.yaml | 69 ++++++++++++++++++++++++++++++++++++++++ prettier.config.js | 7 ++++ src/components/Icons.tsx | 2 +- src/components/Input.tsx | 2 +- src/routes/about.tsx | 10 ------ src/routes/index.tsx | 10 +++--- 7 files changed, 85 insertions(+), 17 deletions(-) create mode 100644 prettier.config.js delete mode 100644 src/routes/about.tsx diff --git a/package.json b/package.json index e4ca575..6224e60 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,8 @@ "devDependencies": { "autoprefixer": "^10.4.19", "postcss": "^8.4.38", + "prettier": "^3.2.5", + "prettier-plugin-tailwindcss": "^0.5.14", "tailwindcss": "^3.4.3" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d7802ff..fe83ceb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,6 +30,12 @@ importers: postcss: specifier: ^8.4.38 version: 8.4.38 + prettier: + specifier: ^3.2.5 + version: 3.2.5 + prettier-plugin-tailwindcss: + specifier: ^0.5.14 + version: 0.5.14(prettier@3.2.5) tailwindcss: specifier: ^3.4.3 version: 3.4.3 @@ -2067,6 +2073,63 @@ packages: resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} engines: {node: ^10 || ^12 || >=14} + prettier-plugin-tailwindcss@0.5.14: + resolution: {integrity: sha512-Puaz+wPUAhFp8Lo9HuciYKM2Y2XExESjeT+9NQoVFXZsPPnc9VYss2SpxdQ6vbatmt8/4+SN0oe0I1cPDABg9Q==} + engines: {node: '>=14.21.3'} + peerDependencies: + '@ianvs/prettier-plugin-sort-imports': '*' + '@prettier/plugin-pug': '*' + '@shopify/prettier-plugin-liquid': '*' + '@trivago/prettier-plugin-sort-imports': '*' + '@zackad/prettier-plugin-twig-melody': '*' + prettier: ^3.0 + prettier-plugin-astro: '*' + prettier-plugin-css-order: '*' + prettier-plugin-import-sort: '*' + prettier-plugin-jsdoc: '*' + prettier-plugin-marko: '*' + prettier-plugin-organize-attributes: '*' + prettier-plugin-organize-imports: '*' + prettier-plugin-sort-imports: '*' + prettier-plugin-style-order: '*' + prettier-plugin-svelte: '*' + peerDependenciesMeta: + '@ianvs/prettier-plugin-sort-imports': + optional: true + '@prettier/plugin-pug': + optional: true + '@shopify/prettier-plugin-liquid': + optional: true + '@trivago/prettier-plugin-sort-imports': + optional: true + '@zackad/prettier-plugin-twig-melody': + optional: true + prettier-plugin-astro: + optional: true + prettier-plugin-css-order: + optional: true + prettier-plugin-import-sort: + optional: true + prettier-plugin-jsdoc: + optional: true + prettier-plugin-marko: + optional: true + prettier-plugin-organize-attributes: + optional: true + prettier-plugin-organize-imports: + optional: true + prettier-plugin-sort-imports: + optional: true + prettier-plugin-style-order: + optional: true + prettier-plugin-svelte: + optional: true + + prettier@3.2.5: + resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} + engines: {node: '>=14'} + hasBin: true + pretty-bytes@6.1.1: resolution: {integrity: sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==} engines: {node: ^14.13.1 || >=16.0.0} @@ -4676,6 +4739,12 @@ snapshots: picocolors: 1.0.1 source-map-js: 1.2.0 + prettier-plugin-tailwindcss@0.5.14(prettier@3.2.5): + dependencies: + prettier: 3.2.5 + + prettier@3.2.5: {} + pretty-bytes@6.1.1: {} process-nextick-args@2.0.1: {} diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 0000000..828dc9b --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,7 @@ +/** @type {import("prettier").Config} */ +export default { + trailingComma: "all", + tabWidth: 2, + singleQuote: false, + plugins: ["prettier-plugin-tailwindcss"], +}; diff --git a/src/components/Icons.tsx b/src/components/Icons.tsx index 65dcc38..1e264eb 100644 --- a/src/components/Icons.tsx +++ b/src/components/Icons.tsx @@ -2,7 +2,7 @@ * @param {string} path * @returns {import("solid-js").VoidComponent} */ -function Icon(path) { +function Icon(path: string): import("solid-js").VoidComponent { return () => ( , "class"> + properties: Omit, "class">, ) { return (

About

- - ); -} diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 5f730d0..562c16a 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -5,7 +5,7 @@ export default function Home() { const [isLocation, setIsLocation] = createSignal(true); return (
-
+ {/* As the naviation UI is bottom to top, we should make the search use the same to be not confusing. Also don't you first think of where you want to go and not where you are right now? */} {/* TODO add animation moving bottom sheet for search into view to get focus from user */} @@ -42,14 +42,14 @@ export default function Home() { class="block w-full rounded-md border-0 py-1.5 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" />