Skip to content

Commit f02a65a

Browse files
committed
build(website): Setup prettier
Install prettier [1] and add the required configuration files for formatting the source code of the website. Ignore Markdown files because they are already checked by Markdownlint. [1]: https://prettier.io/ Signed-off-by: Martin Nonnenmacher <[email protected]>
1 parent fd5805b commit f02a65a

File tree

4 files changed

+47
-3
lines changed

4 files changed

+47
-3
lines changed

website/.prettierignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Ignore markdown files (formatted by another tool)
2+
*.md
3+
*.mdx
4+
5+
# Ignore build output
6+
build/
7+
.docusaurus/
8+
9+
# Ignore node_modules
10+
node_modules/
11+
12+
# Ignore lock files
13+
package-lock.json
14+
15+
# Ignore static assets
16+
static/

website/.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 80,
6+
"tabWidth": 2,
7+
"useTabs": false
8+
}

website/package-lock.json

Lines changed: 18 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"clear": "docusaurus clear",
1212
"serve": "docusaurus serve",
1313
"write-translations": "docusaurus write-translations",
14-
"write-heading-ids": "docusaurus write-heading-ids"
14+
"write-heading-ids": "docusaurus write-heading-ids",
15+
"format": "prettier --write .",
16+
"format:check": "prettier --check ."
1517
},
1618
"dependencies": {
1719
"@docusaurus/core": "3.8.1",
@@ -26,7 +28,8 @@
2628
},
2729
"devDependencies": {
2830
"@docusaurus/module-type-aliases": "3.8.1",
29-
"@docusaurus/types": "3.8.1"
31+
"@docusaurus/types": "3.8.1",
32+
"prettier": "^3.6.2"
3033
},
3134
"browserslist": {
3235
"production": [

0 commit comments

Comments
 (0)