Skip to content

Commit b8714a1

Browse files
committed
Install and document usage of Prettier (code formatter)
1 parent e0802c3 commit b8714a1

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,22 @@ That will launch a local development server and open the website in a web browse
5858

5959
## Code style
6060

61-
// TODO
61+
We use [Prettier](https://prettier.io/) to ensure the code in this repository is in a standard style,
62+
regardless of who wrote the code.
63+
64+
To check whether the code in this repository is in that style, you can run:
65+
66+
```shell
67+
npx prettier . --check
68+
```
69+
70+
If Prettier detects any style issues, it will prompt you to fix the issues by running:
71+
72+
```shell
73+
npx prettier . --write
74+
```
75+
76+
Prettier can check/format files of several types, including: `.md`, `.mdx`, `.js`, `.jsx`, `.ts`, `.tsx`, and `.css`.
6277

6378
## Content
6479

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"@docusaurus/module-type-aliases": "3.5.1",
2929
"@docusaurus/tsconfig": "3.5.1",
3030
"@docusaurus/types": "3.5.1",
31+
"prettier": "3.3.3",
3132
"typescript": "~5.5.2"
3233
},
3334
"browserslist": {

0 commit comments

Comments
 (0)