Skip to content

Commit a4f0821

Browse files
authored
build(oxfmt): migrate prettier to oxfmt (#1203)
1 parent e441d61 commit a4f0821

13 files changed

Lines changed: 220 additions & 232 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"dbaeumer.vscode-eslint",
2222
"eamodio.gitlens",
2323
"EditorConfig.EditorConfig",
24-
"esbenp.prettier-vscode",
24+
"oxc.oxc-vscode",
2525
"firsttris.vscode-jest-runner",
2626
"pkief.material-icon-theme",
2727
"streetsidesoftware.code-spell-checker",

.lintstagedrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"**/*.{js,ts,mjs,mts,md,yml,json,html}": "prettier --write",
2+
"**/*.{js,ts,mjs,mts,md,yml,json,html}": "oxfmt --write",
33
"**/*.{js,ts,mjs,mts}": "eslint --cache --fix"
44
}

.oxfmtrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"printWidth": 100,
4+
"tabWidth": 2,
5+
"semi": true,
6+
"singleQuote": true,
7+
"sortImports": true,
8+
"sortPackageJson": true,
9+
"ignorePatterns": ["dist", "coverage"]
10+
}

.prettierignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"dbaeumer.vscode-eslint",
55
"eamodio.gitlens",
66
"EditorConfig.EditorConfig",
7-
"esbenp.prettier-vscode",
7+
"oxc.oxc-vscode",
88
"streetsidesoftware.code-spell-checker",
99
"yzhang.markdown-all-in-one"
1010
]

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"editor.codeActionsOnSave": {
44
"source.fixAll.eslint": "explicit"
55
},
6-
"editor.defaultFormatter": "esbenp.prettier-vscode",
6+
"editor.defaultFormatter": "oxc.oxc-vscode",
77
"editor.formatOnSave": true,
88
"js/ts.tsdk.path": "node_modules/typescript/lib",
99
"markdown.extension.toc.levels": "2..3"

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"nextjs",
4242
"Nodejitsu",
4343
"ntlm",
44+
"oxfmt",
4445
"pino",
4546
"proxied",
4647
"proxying",

examples/next-app/app/layout.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
import type { Metadata } from "next";
2-
import { Geist, Geist_Mono } from "next/font/google";
3-
import "./globals.css";
1+
import type { Metadata } from 'next';
2+
import { Geist, Geist_Mono } from 'next/font/google';
3+
4+
import './globals.css';
45

56
const geistSans = Geist({
6-
variable: "--font-geist-sans",
7-
subsets: ["latin"],
7+
variable: '--font-geist-sans',
8+
subsets: ['latin'],
89
});
910

1011
const geistMono = Geist_Mono({
11-
variable: "--font-geist-mono",
12-
subsets: ["latin"],
12+
variable: '--font-geist-mono',
13+
subsets: ['latin'],
1314
});
1415

1516
export const metadata: Metadata = {
16-
title: "Create Next App",
17-
description: "Generated by create next app",
17+
title: 'Create Next App',
18+
description: 'Generated by create next app',
1819
};
1920

2021
export default function RootLayout({

examples/next-app/app/page.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import Image from "next/image";
2-
import styles from "./page.module.css";
1+
import Image from 'next/image';
2+
3+
import styles from './page.module.css';
34

45
export default function Home() {
56
return (
@@ -16,22 +17,22 @@ export default function Home() {
1617
<div className={styles.intro}>
1718
<h1>To get started, edit the page.tsx file.</h1>
1819
<p>
19-
Looking for a starting point or more instructions? Head over to{" "}
20+
Looking for a starting point or more instructions? Head over to{' '}
2021
<a
2122
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
2223
target="_blank"
2324
rel="noopener noreferrer"
2425
>
2526
Templates
26-
</a>{" "}
27-
or the{" "}
27+
</a>{' '}
28+
or the{' '}
2829
<a
2930
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
3031
target="_blank"
3132
rel="noopener noreferrer"
3233
>
3334
Learning
34-
</a>{" "}
35+
</a>{' '}
3536
center.
3637
</p>
3738
</div>

0 commit comments

Comments
 (0)