From 2034b970b649b37347921842b5223a7274e34d89 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 22 Jul 2023 17:26:03 -0700 Subject: [PATCH] configure prettier --- .prettierignore | 3 +++ package-lock.json | 16 ++++++++++++++++ package.json | 4 +++- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..3c0687a --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +public +node_modules +.quartz-cache diff --git a/package-lock.json b/package-lock.json index 6ec3910..c0d4c1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -74,6 +74,7 @@ "@types/ws": "^8.5.5", "@types/yargs": "^17.0.24", "esbuild": "^0.18.11", + "prettier": "^3.0.0", "tsx": "^3.12.7", "typescript": "^5.0.4" } @@ -4458,6 +4459,21 @@ "preact": ">=10" } }, + "node_modules/prettier": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz", + "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-bytes": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-6.1.0.tgz", diff --git a/package.json b/package.json index 8b0af9c..64967a6 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "url": "https://github.com/jackyzha0/quartz.git" }, "scripts": { - "typecheck": "tsc --noEmit", + "check": "tsc --noEmit && npx prettier . --check", + "format": "npx prettier . --write", "test": "tsx ./quartz/path.test.ts" }, "keywords": [ @@ -89,6 +90,7 @@ "@types/ws": "^8.5.5", "@types/yargs": "^17.0.24", "esbuild": "^0.18.11", + "prettier": "^3.0.0", "tsx": "^3.12.7", "typescript": "^5.0.4" }