Skip to content

Commit 7c006e5

Browse files
committed
feat: add perttier to format the markdown files
1 parent a9f4bb9 commit 7c006e5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/CONTRIBUTING.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,13 @@ Boot up the documentation site locally, with live reloading of the source code:
4646
$ pnpm run docs:dev
4747
```
4848

49-
If you made a lot of changes, run the following command to check for typos before submitting a pull request:
49+
If you made a lot of changes, run the following command to check for typos & format the docs before submitting a pull request:
50+
51+
> Generally, `nix develop` will add a pre-commit hook to run the following command before you commit.
5052
5153
```sh
5254
$ typos -w
55+
$ prettier --write .
5356
```
5457

5558
After executing the above command, visit <http://localhost:5173> and try modifying the source code. You'll get live update.

flake.nix

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
nodejs = super.nodejs_20;
2020
pnpm = super.nodePackages.pnpm;
2121
yarn = super.yarn.override {inherit nodejs;};
22+
prettier = super.nodePackages.prettier;
2223
})
2324
];
2425
pkgs = import nixpkgs {inherit overlays system;};
@@ -28,6 +29,7 @@
2829
nodejs
2930
pnpm
3031
yarn
32+
prettier
3133

3234
git
3335
typos
@@ -40,12 +42,16 @@
4042
hooks = {
4143
typos.enable = true; # Source code spell checker
4244
alejandra.enable = true; # Nix linter
45+
prettier.enable = true; # Markdown & TS formatter
4346
};
4447
settings = {
4548
typos = {
4649
write = true; # Automatically fix typos
4750
ignored-words = [];
4851
};
52+
prettier = {
53+
write = true; # Automatically format files
54+
};
4955
};
5056
};
5157
};

0 commit comments

Comments
 (0)