Apply Prettier to all files

This commit is contained in:
Marcus Blättermann 2022-11-10 01:01:24 +01:00
parent b473ff528a
commit 3690192dbd
No known key found for this signature in database
GPG Key ID: A1E1F04008AC450D
11 changed files with 8753 additions and 8745 deletions

View File

@ -1,3 +1,3 @@
{ {
"extends": "next/core-web-vitals" "extends": "next/core-web-vitals"
} }

View File

@ -1,4 +1,5 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). This is a [Next.js](https://nextjs.org/) project bootstrapped with
[`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
## Getting Started ## Getting Started
@ -10,25 +11,38 @@ npm run dev
yarn dev yarn dev
``` ```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. Open [http://localhost:3000](http://localhost:3000) with your browser to see the
result.
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. You can start editing the page by modifying `pages/index.tsx`. The page
auto-updates as you edit the file.
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. [API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on
[http://localhost:3000/api/hello](http://localhost:3000/api/hello). This
endpoint can be edited in `pages/api/hello.ts`.
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. The `pages/api` directory is mapped to `/api/*`. Files in this directory are
treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead
of React pages.
## Learn More ## Learn More
To learn more about Next.js, take a look at the following resources: To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! You can check out
[the Next.js GitHub repository](https://github.com/vercel/next.js/) - your
feedback and contributions are welcome!
## Deploy on Vercel ## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. The easiest way to deploy your Next.js app is to use the
[Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme)
from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. Check out our
[Next.js deployment documentation](https://nextjs.org/docs/deployment) for more
details.

View File

@ -1,12 +1,12 @@
const withMDX = require("@next/mdx")({ const withMDX = require('@next/mdx')({
extension: /\.mdx?$/, extension: /\.mdx?$/,
}); })
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = withMDX({ const nextConfig = withMDX({
reactStrictMode: true, reactStrictMode: true,
swcMinify: true, swcMinify: true,
pageExtensions: ["js", "jsx", "ts", "tsx", "md", "mdx"], pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdx'],
}); })
module.exports = nextConfig; module.exports = nextConfig

17066
website/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +1,27 @@
{ {
"name": "next-blog", "name": "next-blog",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint",
"prettier": "prettier . --write" "prettier": "prettier . --write"
}, },
"dependencies": { "dependencies": {
"@mdx-js/loader": "^2.1.5", "@mdx-js/loader": "^2.1.5",
"@mdx-js/react": "^2.1.5", "@mdx-js/react": "^2.1.5",
"@next/mdx": "^13.0.2", "@next/mdx": "^13.0.2",
"@types/node": "18.11.9", "@types/node": "18.11.9",
"@types/react": "18.0.25", "@types/react": "18.0.25",
"@types/react-dom": "18.0.8", "@types/react-dom": "18.0.8",
"eslint": "8.27.0", "eslint": "8.27.0",
"eslint-config-next": "13.0.2", "eslint-config-next": "13.0.2",
"next": "13.0.2", "next": "13.0.2",
"prettier": "^2.7.1", "prettier": "^2.7.1",
"react": "18.2.0", "react": "18.2.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"typescript": "4.8.4" "typescript": "4.8.4"
} }
} }

View File

@ -2,5 +2,5 @@ import '../styles/globals.css'
import type { AppProps } from 'next/app' import type { AppProps } from 'next/app'
export default function App({ Component, pageProps }: AppProps) { export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} /> return <Component {...pageProps} />
} }

View File

@ -2,12 +2,9 @@
import type { NextApiRequest, NextApiResponse } from 'next' import type { NextApiRequest, NextApiResponse } from 'next'
type Data = { type Data = {
name: string name: string
} }
export default function handler( export default function handler(req: NextApiRequest, res: NextApiResponse<Data>) {
req: NextApiRequest, res.status(200).json({ name: 'John Doe' })
res: NextApiResponse<Data>
) {
res.status(200).json({ name: 'John Doe' })
} }

View File

@ -3,69 +3,66 @@ import Image from 'next/image'
import styles from '../styles/Home.module.css' import styles from '../styles/Home.module.css'
export default function Home() { export default function Home() {
return ( return (
<div className={styles.container}> <div className={styles.container}>
<Head> <Head>
<title>Create Next App</title> <title>Create Next App</title>
<meta name="description" content="Generated by create next app" /> <meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
</Head> </Head>
<main className={styles.main}> <main className={styles.main}>
<h1 className={styles.title}> <h1 className={styles.title}>
Welcome to <a href="https://nextjs.org">Next.js!</a> Welcome to <a href="https://nextjs.org">Next.js!</a>
</h1> </h1>
<p className={styles.description}> <p className={styles.description}>
Get started by editing{' '} Get started by editing <code className={styles.code}>pages/index.tsx</code>
<code className={styles.code}>pages/index.tsx</code> </p>
</p>
<div className={styles.grid}> <div className={styles.grid}>
<a href="https://nextjs.org/docs" className={styles.card}> <a href="https://nextjs.org/docs" className={styles.card}>
<h2>Documentation &rarr;</h2> <h2>Documentation &rarr;</h2>
<p>Find in-depth information about Next.js features and API.</p> <p>Find in-depth information about Next.js features and API.</p>
</a> </a>
<a href="https://nextjs.org/learn" className={styles.card}> <a href="https://nextjs.org/learn" className={styles.card}>
<h2>Learn &rarr;</h2> <h2>Learn &rarr;</h2>
<p>Learn about Next.js in an interactive course with quizzes!</p> <p>Learn about Next.js in an interactive course with quizzes!</p>
</a> </a>
<a <a
href="https://github.com/vercel/next.js/tree/canary/examples" href="https://github.com/vercel/next.js/tree/canary/examples"
className={styles.card} className={styles.card}
> >
<h2>Examples &rarr;</h2> <h2>Examples &rarr;</h2>
<p>Discover and deploy boilerplate example Next.js projects.</p> <p>Discover and deploy boilerplate example Next.js projects.</p>
</a> </a>
<a <a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
className={styles.card} className={styles.card}
> >
<h2>Deploy &rarr;</h2> <h2>Deploy &rarr;</h2>
<p> <p>Instantly deploy your Next.js site to a public URL with Vercel.</p>
Instantly deploy your Next.js site to a public URL with Vercel. </a>
</p> </div>
</a> </main>
<footer className={styles.footer}>
<a
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Powered by{' '}
<span className={styles.logo}>
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
</span>
</a>
</footer>
</div> </div>
</main> )
<footer className={styles.footer}>
<a
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Powered by{' '}
<span className={styles.logo}>
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
</span>
</a>
</footer>
</div>
)
} }

View File

@ -1,129 +1,129 @@
.container { .container {
padding: 0 2rem; padding: 0 2rem;
} }
.main { .main {
min-height: 100vh; min-height: 100vh;
padding: 4rem 0; padding: 4rem 0;
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.footer { .footer {
display: flex; display: flex;
flex: 1; flex: 1;
padding: 2rem 0; padding: 2rem 0;
border-top: 1px solid #eaeaea; border-top: 1px solid #eaeaea;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.footer a { .footer a {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-grow: 1; flex-grow: 1;
} }
.title a { .title a {
color: #0070f3; color: #0070f3;
text-decoration: none; text-decoration: none;
} }
.title a:hover, .title a:hover,
.title a:focus, .title a:focus,
.title a:active { .title a:active {
text-decoration: underline; text-decoration: underline;
} }
.title { .title {
margin: 0; margin: 0;
line-height: 1.15; line-height: 1.15;
font-size: 4rem; font-size: 4rem;
} }
.title, .title,
.description { .description {
text-align: center; text-align: center;
} }
.description { .description {
margin: 4rem 0; margin: 4rem 0;
line-height: 1.5; line-height: 1.5;
font-size: 1.5rem; font-size: 1.5rem;
} }
.code { .code {
background: #fafafa; background: #fafafa;
border-radius: 5px; border-radius: 5px;
padding: 0.75rem; padding: 0.75rem;
font-size: 1.1rem; font-size: 1.1rem;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
Bitstream Vera Sans Mono, Courier New, monospace; Bitstream Vera Sans Mono, Courier New, monospace;
} }
.grid { .grid {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
max-width: 800px; max-width: 800px;
} }
.card { .card {
margin: 1rem; margin: 1rem;
padding: 1.5rem; padding: 1.5rem;
text-align: left; text-align: left;
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
border: 1px solid #eaeaea; border: 1px solid #eaeaea;
border-radius: 10px; border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease; transition: color 0.15s ease, border-color 0.15s ease;
max-width: 300px; max-width: 300px;
} }
.card:hover, .card:hover,
.card:focus, .card:focus,
.card:active { .card:active {
color: #0070f3; color: #0070f3;
border-color: #0070f3; border-color: #0070f3;
} }
.card h2 { .card h2 {
margin: 0 0 1rem 0; margin: 0 0 1rem 0;
font-size: 1.5rem; font-size: 1.5rem;
} }
.card p { .card p {
margin: 0; margin: 0;
font-size: 1.25rem; font-size: 1.25rem;
line-height: 1.5; line-height: 1.5;
} }
.logo { .logo {
height: 1em; height: 1em;
margin-left: 0.5rem; margin-left: 0.5rem;
} }
@media (max-width: 600px) { @media (max-width: 600px) {
.grid { .grid {
width: 100%; width: 100%;
flex-direction: column; flex-direction: column;
} }
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
.card, .card,
.footer { .footer {
border-color: #222; border-color: #222;
} }
.code { .code {
background: #111; background: #111;
} }
.logo img { .logo img {
filter: invert(1); filter: invert(1);
} }
} }

View File

@ -1,26 +1,26 @@
html, html,
body { body {
padding: 0; padding: 0;
margin: 0; margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
} }
a { a {
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
} }
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
html { html {
color-scheme: dark; color-scheme: dark;
} }
body { body {
color: white; color: white;
background: black; background: black;
} }
} }

View File

@ -1,20 +1,20 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es5",
"lib": ["dom", "dom.iterable", "esnext"], "lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": false, "strict": false,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"noEmit": true, "noEmit": true,
"esModuleInterop": true, "esModuleInterop": true,
"module": "esnext", "module": "esnext",
"moduleResolution": "node", "moduleResolution": "node",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"jsx": "preserve", "jsx": "preserve",
"incremental": true "incremental": true
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"] "exclude": ["node_modules"]
} }