From f7d440ef861122361e99f283ce0101c702ac0d24 Mon Sep 17 00:00:00 2001 From: sebasti810 Date: Thu, 9 Jan 2025 13:57:47 +0100 Subject: [PATCH] fix: run prettier --- .vscode/css.code-snippets | 6 +- .vscode/settings.json | 7 +- .vscode/typescriptreact.code-snippets | 74 +++++++------- src/__mocks__/svg.tsx | 6 +- src/app/components/page.tsx | 135 +++++++------------------ src/app/error.tsx | 9 +- src/app/not-found.tsx | 5 +- src/components/NextImage.tsx | 9 +- src/components/buttons/Button.tsx | 51 +++------- src/components/buttons/IconButton.tsx | 35 +++---- src/components/buttons/TextButton.tsx | 13 +-- src/components/links/ArrowLink.tsx | 6 +- src/components/links/ButtonLink.tsx | 50 +++------ src/components/links/IconLink.tsx | 38 ++----- src/components/links/PrimaryLink.tsx | 6 +- src/components/links/UnderlineLink.tsx | 8 +- src/components/links/UnstyledLink.tsx | 8 +- src/lib/og.ts | 4 +- 18 files changed, 142 insertions(+), 328 deletions(-) diff --git a/.vscode/css.code-snippets b/.vscode/css.code-snippets index 82cc815..951943e 100644 --- a/.vscode/css.code-snippets +++ b/.vscode/css.code-snippets @@ -4,7 +4,7 @@ "body": [ "/* #region /**=========== ${1} =========== */", "$0", - "/* #endregion /**======== ${1} =========== */" - ] - } + "/* #endregion /**======== ${1} =========== */", + ], + }, } diff --git a/.vscode/settings.json b/.vscode/settings.json index a775463..3a3e397 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,11 +7,6 @@ }, "[css]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, // Tailwind CSS Autocomplete, add more if used in projects - "tailwindCSS.classAttributes": [ - "class", - "className", - "classNames", - "containerClassName" - ], + "tailwindCSS.classAttributes": ["class", "className", "classNames", "containerClassName"], "typescript.preferences.importModuleSpecifier": "non-relative" } diff --git a/.vscode/typescriptreact.code-snippets b/.vscode/typescriptreact.code-snippets index 1fce740..a691cf0 100644 --- a/.vscode/typescriptreact.code-snippets +++ b/.vscode/typescriptreact.code-snippets @@ -2,29 +2,25 @@ //#region //*=========== React =========== "import React": { "prefix": "ir", - "body": ["import * as React from 'react';"] + "body": ["import * as React from 'react';"], }, "React.useState": { "prefix": "us", "body": [ - "const [${1}, set${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}] = React.useState<$3>(${2:initial${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}})$0" - ] + "const [${1}, set${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}] = React.useState<$3>(${2:initial${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}})$0", + ], }, "React.useEffect": { "prefix": "uf", - "body": ["React.useEffect(() => {", " $0", "}, []);"] + "body": ["React.useEffect(() => {", " $0", "}, []);"], }, "React.useReducer": { "prefix": "ur", - "body": [ - "const [state, dispatch] = React.useReducer(${0:someReducer}, {", - " ", - "})" - ] + "body": ["const [state, dispatch] = React.useReducer(${0:someReducer}, {", " ", "})"], }, "React.useRef": { "prefix": "urf", - "body": ["const ${1:someRef} = React.useRef($0)"] + "body": ["const ${1:someRef} = React.useRef($0)"], }, "React Functional Component": { "prefix": "rc", @@ -36,8 +32,8 @@ " $0", " ", " )", - "}" - ] + "}", + ], }, "React Functional Component with Props": { "prefix": "rcp", @@ -52,8 +48,8 @@ " $0", " ", " )", - "}" - ] + "}", + ], }, //#endregion //*======== React =========== @@ -64,8 +60,8 @@ "body": [ "//#region //*=========== ${1} ===========", "${TM_SELECTED_TEXT}$0", - "//#endregion //*======== ${1} ===========" - ] + "//#endregion //*======== ${1} ===========", + ], }, "Region CSS": { "prefix": "regc", @@ -73,8 +69,8 @@ "body": [ "/* #region /**=========== ${1} =========== */", "${TM_SELECTED_TEXT}$0", - "/* #endregion /**======== ${1} =========== */" - ] + "/* #endregion /**======== ${1} =========== */", + ], }, //#endregion //*======== Commons =========== @@ -98,8 +94,8 @@ " ", " ", " )", - "}" - ] + "}", + ], }, "Next API": { "prefix": "napi", @@ -111,8 +107,8 @@ " } else {", " res.status(405).json({ message: 'Method Not Allowed' });", " }", - "}" - ] + "}", + ], }, "Get Static Props": { "prefix": "gsp", @@ -121,8 +117,8 @@ " return {", " props: {}", " };", - "}" - ] + "}", + ], }, "Get Static Paths": { "prefix": "gspa", @@ -134,8 +130,8 @@ " ],", " fallback: ", " };", - "}" - ] + "}", + ], }, "Get Server Side Props": { "prefix": "gssp", @@ -144,50 +140,48 @@ " return {", " props: {}", " };", - "}" - ] + "}", + ], }, "Infer Get Static Props": { "prefix": "igsp", - "body": "InferGetStaticPropsType" + "body": "InferGetStaticPropsType", }, "Infer Get Server Side Props": { "prefix": "igssp", - "body": "InferGetServerSidePropsType" + "body": "InferGetServerSidePropsType", }, "Import useRouter": { "prefix": "imust", - "body": ["import { useRouter } from 'next/router';"] + "body": ["import { useRouter } from 'next/router';"], }, "Import Next Image": { "prefix": "imimg", - "body": ["import Image from 'next/image';"] + "body": ["import Image from 'next/image';"], }, "Import Next Link": { "prefix": "iml", - "body": ["import Link from 'next/link';"] + "body": ["import Link from 'next/link';"], }, //#endregion //*======== Next.js =========== //#region //*=========== Snippet Wrap =========== "Wrap with Fragment": { "prefix": "ff", - "body": ["<>", "\t${TM_SELECTED_TEXT}", ""] + "body": ["<>", "\t${TM_SELECTED_TEXT}", ""], }, "Wrap with clsx": { "prefix": "cx", - "body": ["{clsx([${TM_SELECTED_TEXT}$0])}"] + "body": ["{clsx([${TM_SELECTED_TEXT}$0])}"], }, "Wrap with clsxm": { "prefix": "cxm", - "body": ["{clsxm([${TM_SELECTED_TEXT}$0, className])}"] + "body": ["{clsxm([${TM_SELECTED_TEXT}$0, className])}"], }, //#endregion //*======== Snippet Wrap =========== "Logger": { "prefix": "lg", - "body": [ - "logger({ ${1:${CLIPBOARD}} }, '${TM_FILENAME} line ${TM_LINE_NUMBER}')" - ] - } + "body": ["logger({ ${1:${CLIPBOARD}} }, '${TM_FILENAME} line ${TM_LINE_NUMBER}')"], + }, } diff --git a/src/__mocks__/svg.tsx b/src/__mocks__/svg.tsx index f973aa3..8505f06 100644 --- a/src/__mocks__/svg.tsx +++ b/src/__mocks__/svg.tsx @@ -1,8 +1,8 @@ import React, { SVGProps } from 'react'; -const SvgrMock = React.forwardRef>( - (props, ref) => -); +const SvgrMock = React.forwardRef>((props, ref) => ( + +)); export const ReactComponent = SvgrMock; export default SvgrMock; diff --git a/src/app/components/page.tsx b/src/app/components/page.tsx index 947aea9..f2391e1 100644 --- a/src/app/components/page.tsx +++ b/src/app/components/page.tsx @@ -1,14 +1,7 @@ 'use client'; import clsx from 'clsx'; -import { - ArrowRight, - CreditCard, - Laptop, - Phone, - Plus, - Shield, -} from 'lucide-react'; +import { ArrowRight, CreditCard, Laptop, Phone, Plus, Shield } from 'lucide-react'; import React from 'react'; import Button from '@/components/buttons/Button'; @@ -35,9 +28,7 @@ export default function ComponentPage() { return (
-
+
- {/* */} @@ -63,8 +51,8 @@ export default function ComponentPage() {
  • Customize Colors

    - You can change primary color to any Tailwind CSS colors. See - globals.css to change your color. + You can change primary color to any Tailwind CSS colors. See globals.css to change + your color.