From 7188342c3869e845a4a47577399208177cf376eb Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Mon, 9 Feb 2026 01:44:28 +0100 Subject: [PATCH] chore(tooling): add and configure prettier for formatting --- .editorconfig | 11 +++++++++++ .prettierignore | 3 +++ bun.lock | 3 +++ package.json | 5 ++++- prettier.config.ts | 8 ++++++++ 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .editorconfig create mode 100644 .prettierignore create mode 100644 prettier.config.ts diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..aec052f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{yml,yaml}] +indent_size = 2 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..0c1f900 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +.DS_Store +dist/ +node_modules/ diff --git a/bun.lock b/bun.lock index d623aa8..2bc3995 100644 --- a/bun.lock +++ b/bun.lock @@ -5,6 +5,7 @@ "": { "name": "anti-slop", "devDependencies": { + "prettier": "3.8.1", "tsdown": "^0.20.3", }, }, @@ -106,6 +107,8 @@ "picomatch": ["picomatch@4.0.3", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="], + "prettier": ["prettier@3.8.1", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg=="], + "quansync": ["quansync@1.0.0", "", {}, "sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA=="], "resolve-pkg-maps": ["resolve-pkg-maps@1.0.0", "", {}, "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw=="], diff --git a/package.json b/package.json index 5519721..2806f08 100644 --- a/package.json +++ b/package.json @@ -18,10 +18,13 @@ "node": ">=24.0.0" }, "devDependencies": { + "prettier": "3.8.1", "tsdown": "^0.20.3" }, "scripts": { "build": "tsdown", - "dev": "tsdown --watch" + "dev": "tsdown --watch", + "format": "bunx --bun prettier . --write", + "test:format": "bunx --bun prettier --check ." } } diff --git a/prettier.config.ts b/prettier.config.ts new file mode 100644 index 0000000..22df973 --- /dev/null +++ b/prettier.config.ts @@ -0,0 +1,8 @@ +import { type Config } from "prettier"; + +const config: Config = { + printWidth: 100, + useTabs: false, +}; + +export default config;