From 4bb803dcfc774f22c5578821ae46753052bb2f87 Mon Sep 17 00:00:00 2001 From: emiljohansson Date: Sat, 18 Feb 2023 16:38:09 -0700 Subject: [PATCH] change prettier to single quotes --- .prettierrc | 2 +- apps/next/app/layout.tsx | 17 ++++++++--------- packages/shared/CheckboxWithLabel.tsx | 6 +++--- packages/shared/Header.tsx | 6 +++--- packages/shared/HeaderAction.tsx | 2 +- packages/shared/Progress.tsx | 16 ++++++++-------- packages/shared/Slider.tsx | 6 +++--- packages/shared/ThemeToggle.tsx | 16 ++++++++-------- packages/shared/styled-jsx.d.ts | 4 ++-- 9 files changed, 37 insertions(+), 38 deletions(-) diff --git a/.prettierrc b/.prettierrc index 9e8a261..c239ad7 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,7 +1,7 @@ { "semi": false, "useTabs": true, - "singleQuote": false, + "singleQuote": true, "trailingComma": "all", "printWidth": 100, "plugins": [], diff --git a/apps/next/app/layout.tsx b/apps/next/app/layout.tsx index b5b1603..ff4a0c8 100644 --- a/apps/next/app/layout.tsx +++ b/apps/next/app/layout.tsx @@ -2,13 +2,12 @@ import 'shared/globals.css' import { PropsWithChildren } from 'react' -export default function Layout ({ children }: PropsWithChildren) { - return ( - - -
- {children} -
- - ) +export default function Layout({ children }: PropsWithChildren) { + return ( + + +
{children}
+ + + ) } diff --git a/packages/shared/CheckboxWithLabel.tsx b/packages/shared/CheckboxWithLabel.tsx index f83f342..b02f865 100644 --- a/packages/shared/CheckboxWithLabel.tsx +++ b/packages/shared/CheckboxWithLabel.tsx @@ -1,6 +1,6 @@ -import type { CheckboxProps } from "@radix-ui/react-checkbox" -import { Root, Indicator } from "@radix-ui/react-checkbox" -import { CheckIcon } from "@radix-ui/react-icons" +import type { CheckboxProps } from '@radix-ui/react-checkbox' +import { Root, Indicator } from '@radix-ui/react-checkbox' +import { CheckIcon } from '@radix-ui/react-icons' interface Props extends CheckboxProps { labelText: string diff --git a/packages/shared/Header.tsx b/packages/shared/Header.tsx index 13ce8e7..d8b9914 100644 --- a/packages/shared/Header.tsx +++ b/packages/shared/Header.tsx @@ -1,6 +1,6 @@ -import type { PropsWithChildren } from "react" -import Link from "next/link" -import { FiArrowLeft } from "react-icons/fi" +import type { PropsWithChildren } from 'react' +import Link from 'next/link' +import { FiArrowLeft } from 'react-icons/fi' const Header = ({ children }: PropsWithChildren) => { return ( diff --git a/packages/shared/HeaderAction.tsx b/packages/shared/HeaderAction.tsx index 1e25bd4..c54eb04 100644 --- a/packages/shared/HeaderAction.tsx +++ b/packages/shared/HeaderAction.tsx @@ -1,4 +1,4 @@ -import type { PropsWithChildren, ReactNode } from "react" +import type { PropsWithChildren, ReactNode } from 'react' const HeaderAction = ({ children, diff --git a/packages/shared/Progress.tsx b/packages/shared/Progress.tsx index e2a327f..edb9eff 100644 --- a/packages/shared/Progress.tsx +++ b/packages/shared/Progress.tsx @@ -1,13 +1,13 @@ -import { Root, Indicator } from "@radix-ui/react-progress" -import { motion } from "framer-motion" -import { classNames } from "lib/utils/string" +import { Root, Indicator } from '@radix-ui/react-progress' +import { motion } from 'framer-motion' +import { classNames } from 'lib/utils/string' export const Progress = ({ progress }: { progress: number }) => { - let colorClass = "bg-green-400" + let colorClass = 'bg-green-400' if (progress <= 25) { - colorClass = "bg-red-400" + colorClass = 'bg-red-400' } else if (progress <= 50) { - colorClass = "bg-yellow-200" + colorClass = 'bg-yellow-200' } return ( { > diff --git a/packages/shared/Slider.tsx b/packages/shared/Slider.tsx index f20862c..056b19c 100644 --- a/packages/shared/Slider.tsx +++ b/packages/shared/Slider.tsx @@ -1,7 +1,7 @@ -import type { SliderProps } from "@radix-ui/react-slider" -import { Root, Track, Range, Thumb } from "@radix-ui/react-slider" +import type { SliderProps } from '@radix-ui/react-slider' +import { Root, Track, Range, Thumb } from '@radix-ui/react-slider' -interface Props extends Omit { +interface Props extends Omit { defaultValue: number label?: string } diff --git a/packages/shared/ThemeToggle.tsx b/packages/shared/ThemeToggle.tsx index 95f1e04..9d5756f 100644 --- a/packages/shared/ThemeToggle.tsx +++ b/packages/shared/ThemeToggle.tsx @@ -1,8 +1,8 @@ -import { useEffect, useState } from "react" -import { motion } from "framer-motion" -import { MoonIcon, SunIcon } from "@radix-ui/react-icons" +import { useEffect, useState } from 'react' +import { motion } from 'framer-motion' +import { MoonIcon, SunIcon } from '@radix-ui/react-icons' -const darkClassName = "dark" +const darkClassName = 'dark' let savedDarkMode: boolean | undefined const useDarkMode = () => { @@ -14,7 +14,7 @@ const useDarkMode = () => { savedDarkMode = document.documentElement.classList.contains(darkClassName) return } - localStorage.setItem("theme", darkMode ? darkClassName : "") + localStorage.setItem('theme', darkMode ? darkClassName : '') document.documentElement.classList.toggle(darkClassName, localStorage.theme === darkClassName) savedDarkMode = document.documentElement.classList.contains(darkClassName) }, [darkMode]) @@ -35,16 +35,16 @@ export const ThemeToggle = () => { initial={{ scale: darkMode === undefined ? 0.5 : 1, opacity: darkMode === undefined ? 0 : 1, - y: darkMode === undefined ? "-100%" : 0, + y: darkMode === undefined ? '-100%' : 0, }} animate={{ scale: darkMode === undefined ? 0.5 : 1, opacity: darkMode === undefined ? 0 : 1, - y: darkMode === undefined ? "-100%" : 0, + y: darkMode === undefined ? '-100%' : 0, }} transition={{ duration: 0.5, delay: 0.5 }} > - Use {darkMode ? "dark" : "light"} mode + Use {darkMode ? 'dark' : 'light'} mode {darkMode ? ( ) : ( diff --git a/packages/shared/styled-jsx.d.ts b/packages/shared/styled-jsx.d.ts index 86e5f3e..a1273d4 100644 --- a/packages/shared/styled-jsx.d.ts +++ b/packages/shared/styled-jsx.d.ts @@ -1,6 +1,6 @@ -import "react" +import 'react' -declare module "react" { +declare module 'react' { interface StyleHTMLAttributes extends React.HTMLAttributes { jsx?: boolean global?: boolean