From 9b6004f364314730cdcbacac22ede98d8b02cef0 Mon Sep 17 00:00:00 2001 From: Valentin Maerten Date: Fri, 8 Aug 2025 10:12:00 +0200 Subject: [PATCH] add prettier --- website/Taskfile.yml | 6 ++++++ website/package.json | 4 +++- website/pnpm-lock.yaml | 10 ++++++++++ website/prettier.config.js | 19 +++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 website/prettier.config.js diff --git a/website/Taskfile.yml b/website/Taskfile.yml index a5a7da6e..d78c7107 100644 --- a/website/Taskfile.yml +++ b/website/Taskfile.yml @@ -19,6 +19,12 @@ tasks: cmds: - pnpm dev --host={{.HOST}} --port={{.PORT}} + lint: + desc: Lint website + deps: [install] + cmds: + - pnpm lint + build: desc: Build website deps: [install] diff --git a/website/package.json b/website/package.json index 11316d36..bd661311 100644 --- a/website/package.json +++ b/website/package.json @@ -6,7 +6,8 @@ "scripts": { "dev": "vitepress dev", "build": "vitepress build", - "preview": "vitepress preview" + "preview": "vitepress preview", + "lint": "prettier --check ." }, "keywords": [], "author": "", @@ -15,6 +16,7 @@ "@types/markdown-it": "^14.1.2", "@types/node": "^24.1.0", "netlify-cli": "^23.1.1", + "prettier": "^3.6.2", "vitepress": "^1.6.3", "vitepress-plugin-group-icons": "^1.6.1", "vitepress-plugin-tabs": "^0.7.1", diff --git a/website/pnpm-lock.yaml b/website/pnpm-lock.yaml index f7ceed51..84e4937e 100644 --- a/website/pnpm-lock.yaml +++ b/website/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: netlify-cli: specifier: ^23.1.1 version: 23.1.1(@types/node@24.1.0)(picomatch@4.0.3)(rollup@4.45.1) + prettier: + specifier: ^3.6.2 + version: 3.6.2 vitepress: specifier: ^1.6.3 version: 1.6.3(@algolia/client-search@5.34.1)(@types/node@24.1.0)(jwt-decode@4.0.0)(postcss@8.5.6)(search-insights@2.17.3)(typescript@5.9.2) @@ -3555,6 +3558,11 @@ packages: resolution: {integrity: sha512-QCYG84SgGyGzqJ/vlMsxeXd/pgL/I94ixdNFyh1PusWmTCyVfPJjZ1K1jvHtsbfnXQs2TSkEP2fR7QiMZAnKFQ==} engines: {node: '>= 0.6'} + prettier@3.6.2: + resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==} + engines: {node: '>=14'} + hasBin: true + pretty-ms@9.2.0: resolution: {integrity: sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==} engines: {node: '>=18'} @@ -8305,6 +8313,8 @@ snapshots: precond@0.2.3: {} + prettier@3.6.2: {} + pretty-ms@9.2.0: dependencies: parse-ms: 4.0.0 diff --git a/website/prettier.config.js b/website/prettier.config.js new file mode 100644 index 00000000..ac45842c --- /dev/null +++ b/website/prettier.config.js @@ -0,0 +1,19 @@ +/** + * @see https://prettier.io/docs/configuration + * @type {import("prettier").Config} + */ +const config = { + trailingComma: 'none', + singleQuote: true, + overrides: [ + { + files: ['*.md'], + options: { + printWidth: 80, + proseWrap: 'always' + } + } + ] +}; + +export default config;