From 81159ba9b62a38455e72c1c1d0aa91219731912e Mon Sep 17 00:00:00 2001 From: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com> Date: Thu, 26 Feb 2026 16:00:21 +0100 Subject: [PATCH] web: Use local development prettier config. --- web/package-lock.json | 35 +++++++++++++++++++++++++++++++++++ web/package.json | 3 ++- web/prettier.config.mjs | 15 +++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 web/prettier.config.mjs diff --git a/web/package-lock.json b/web/package-lock.json index 7480fe1e77..cf323aaf69 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -127,12 +127,43 @@ "@esbuild/darwin-arm64": "^0.27.3", "@esbuild/linux-arm64": "^0.27.3", "@esbuild/linux-x64": "^0.27.3", + "@goauthentik/prettier-config-dev": "../packages/prettier-config", "@rollup/rollup-darwin-arm64": "^4.57.1", "@rollup/rollup-linux-arm64-gnu": "^4.57.1", "@rollup/rollup-linux-x64-gnu": "^4.57.1", "chromedriver": "^145.0.3" } }, + "../packages/prettier-config": { + "name": "@goauthentik/prettier-config", + "version": "3.4.1", + "license": "MIT", + "optional": true, + "dependencies": { + "format-imports": "^4.0.8" + }, + "devDependencies": { + "@eslint/js": "^9.39.3", + "@goauthentik/eslint-config": "../eslint-config", + "@goauthentik/tsconfig": "../tsconfig", + "@types/node": "^25.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.49.0", + "eslint": "^9.39.3", + "prettier": "^3.8.1", + "prettier-plugin-packagejson": "^3.0.0", + "typescript": "^5.9.3", + "typescript-eslint": "^8.56.1" + }, + "engines": { + "node": ">=24", + "npm": ">=11.10.1" + }, + "peerDependencies": { + "prettier": "^3.8.1", + "prettier-plugin-packagejson": "^3.0.0" + } + }, "node_modules/@adobe/css-tools": { "version": "4.4.4", "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.4.tgz", @@ -1495,6 +1526,10 @@ "prettier-plugin-packagejson": "^3.0.0" } }, + "node_modules/@goauthentik/prettier-config-dev": { + "resolved": "../packages/prettier-config", + "link": true + }, "node_modules/@goauthentik/tsconfig": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@goauthentik/tsconfig/-/tsconfig-1.0.5.tgz", diff --git a/web/package.json b/web/package.json index 60d3d29239..50ef3c06ca 100644 --- a/web/package.json +++ b/web/package.json @@ -198,6 +198,7 @@ "@esbuild/darwin-arm64": "^0.27.3", "@esbuild/linux-arm64": "^0.27.3", "@esbuild/linux-x64": "^0.27.3", + "@goauthentik/prettier-config-dev": "../packages/prettier-config", "@rollup/rollup-darwin-arm64": "^4.57.1", "@rollup/rollup-linux-arm64-gnu": "^4.57.1", "@rollup/rollup-linux-x64-gnu": "^4.57.1", @@ -315,7 +316,7 @@ "onFail": "warn" } }, - "prettier": "@goauthentik/prettier-config", + "prettier": "./prettier.config.mjs", "overrides": { "@goauthentik/esbuild-plugin-live-reload": { "esbuild": "$esbuild" diff --git a/web/prettier.config.mjs b/web/prettier.config.mjs new file mode 100644 index 0000000000..cc043614bb --- /dev/null +++ b/web/prettier.config.mjs @@ -0,0 +1,15 @@ +/** + * @file Prettier config resolver. + * + * This file attempts to import the monorepo's local Prettier config package, + * falling back to the published version if the local one cannot be found. + */ + +const config = await import("@goauthentik/prettier-config-dev") + .catch(() => { + console.debug("Fallback to published @goauthentik/prettier-config"); + return import("@goauthentik/prettier-config"); + }) + .then((module) => module.default); + +export default config;