From 20a425df6e0a3856a67513058779d0ccb1e81655 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Thu, 2 Dec 2021 17:49:46 -0600 Subject: [PATCH] Prettier: no semi, spaces 2, single quote, trailing comma --- web/.prettierrc | 8 +++++++- web/README.md | 2 +- web/components/convert-kit-email-form.tsx | 6 +++--- web/components/hero.tsx | 16 ++++++++-------- web/next.config.js | 2 +- web/package.json | 3 ++- web/pages/_app.tsx | 8 ++++---- web/pages/api/hello.ts | 8 ++++---- web/pages/index.tsx | 14 +++++++------- web/postcss.config.js | 2 +- web/tailwind.config.js | 12 ++++++------ 11 files changed, 44 insertions(+), 37 deletions(-) diff --git a/web/.prettierrc b/web/.prettierrc index 0967ef42..bd18729f 100644 --- a/web/.prettierrc +++ b/web/.prettierrc @@ -1 +1,7 @@ -{} +{ + "tabWidth": 2, + "useTabs": false, + "semi": false, + "trailingComma": "es5", + "singleQuote": true +} diff --git a/web/README.md b/web/README.md index 30869057..9902ae97 100644 --- a/web/README.md +++ b/web/README.md @@ -8,6 +8,6 @@ ## Formatting -Before committing, run `npx prettier --write . ` +Before committing, run `npm run format` to format your code. Recommended: Use a [Prettier editor integration](https://prettier.io/docs/en/editors.html) to automatically format on save diff --git a/web/components/convert-kit-email-form.tsx b/web/components/convert-kit-email-form.tsx index 00c0e788..4d8f06c3 100644 --- a/web/components/convert-kit-email-form.tsx +++ b/web/components/convert-kit-email-form.tsx @@ -1,6 +1,6 @@ export const ConvertKitEmailForm = () => { - return
; -}; + return
+} const convertkitHTML = { __html: ` @@ -23,4 +23,4 @@ const convertkitHTML = { `, -}; +} diff --git a/web/components/hero.tsx b/web/components/hero.tsx index 6b3d3475..07df912f 100644 --- a/web/components/hero.tsx +++ b/web/components/hero.tsx @@ -1,13 +1,13 @@ -import { Popover } from "@headlessui/react"; -import { ConvertKitEmailForm } from "./convert-kit-email-form"; +import { Popover } from '@headlessui/react' +import { ConvertKitEmailForm } from './convert-kit-email-form' const navigation = [ { - name: "About", - href: "https://mantic.notion.site/About-Mantic-Markets-09bdde9044614e62a27477b4b1bf77ea", + name: 'About', + href: 'https://mantic.notion.site/About-Mantic-Markets-09bdde9044614e62a27477b4b1bf77ea', }, - { name: "Simulator", href: "https://simulator.mantic.markets" }, -]; + { name: 'Simulator', href: 'https://simulator.mantic.markets' }, +] export const Hero = () => { return ( @@ -78,5 +78,5 @@ export const Hero = () => {
- ); -}; + ) +} diff --git a/web/next.config.js b/web/next.config.js index 3dd7ef15..8b61df4e 100644 --- a/web/next.config.js +++ b/web/next.config.js @@ -1,4 +1,4 @@ /** @type {import('next').NextConfig} */ module.exports = { reactStrictMode: true, -}; +} diff --git a/web/package.json b/web/package.json index adca4348..189a19c8 100644 --- a/web/package.json +++ b/web/package.json @@ -5,7 +5,8 @@ "dev": "next dev", "build": "next build && next export", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "format": "npx prettier --write ." }, "dependencies": { "@headlessui/react": "^1.4.2", diff --git a/web/pages/_app.tsx b/web/pages/_app.tsx index 185a168e..8e5360d9 100644 --- a/web/pages/_app.tsx +++ b/web/pages/_app.tsx @@ -1,8 +1,8 @@ -import "tailwindcss/tailwind.css"; -import type { AppProps } from "next/app"; +import 'tailwindcss/tailwind.css' +import type { AppProps } from 'next/app' function MyApp({ Component, pageProps }: AppProps) { - return ; + return } -export default MyApp; +export default MyApp diff --git a/web/pages/api/hello.ts b/web/pages/api/hello.ts index 74a3605d..f8bcc7e5 100644 --- a/web/pages/api/hello.ts +++ b/web/pages/api/hello.ts @@ -1,13 +1,13 @@ // Next.js API route support: https://nextjs.org/docs/api-routes/introduction -import type { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from 'next' type Data = { - name: string; -}; + name: string +} export default function handler( req: NextApiRequest, res: NextApiResponse ) { - res.status(200).json({ name: "John Doe" }); + res.status(200).json({ name: 'John Doe' }) } diff --git a/web/pages/index.tsx b/web/pages/index.tsx index 8bb1ac5d..bf1c8680 100644 --- a/web/pages/index.tsx +++ b/web/pages/index.tsx @@ -1,7 +1,7 @@ -import type { NextPage } from "next"; -import Head from "next/head"; -import React from "react"; -import { Hero } from "../components/hero"; +import type { NextPage } from 'next' +import Head from 'next/head' +import React from 'react' +import { Hero } from '../components/hero' const Home: NextPage = () => { return ( @@ -21,7 +21,7 @@ const Home: NextPage = () => { - ); -}; + ) +} -export default Home; +export default Home diff --git a/web/postcss.config.js b/web/postcss.config.js index 3687d286..3fa0a951 100644 --- a/web/postcss.config.js +++ b/web/postcss.config.js @@ -5,4 +5,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -}; +} diff --git a/web/tailwind.config.js b/web/tailwind.config.js index acfe6d42..5daa7207 100644 --- a/web/tailwind.config.js +++ b/web/tailwind.config.js @@ -1,19 +1,19 @@ module.exports = { - mode: "jit", - purge: ["./pages/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}"], + mode: 'jit', + purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'], darkMode: false, // or 'media' or 'class' theme: { fontFamily: { - "major-mono": ["Major Mono Display", "monospace"], + 'major-mono': ['Major Mono Display', 'monospace'], }, extend: { backgroundImage: { - "world-trading": "url('/world-trading-background.jpg')", + 'world-trading': "url('/world-trading-background.jpg')", }, }, }, variants: { extend: {}, }, - plugins: [require("@tailwindcss/forms")], -}; + plugins: [require('@tailwindcss/forms')], +}