From 0fc3528df28c225b9f42f72bbaf358df53d17931 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 15 Jul 2026 10:22:44 +0100 Subject: [PATCH 1/3] Added pre-commit config for formatting the UI code --- .pre-commit-config.yaml | 5 +++++ CHANGELOG.md | 1 + ui/app/.prettierrc | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7b54376f9c..1b5ed8b7ec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,3 +8,8 @@ repos: rev: v2.4.2 hooks: - id: codespell + - repo: https://github.com/rbubley/mirrors-prettier + rev: v3.5.0 + hooks: + - id: prettier + files: ^ui/app diff --git a/CHANGELOG.md b/CHANGELOG.md index 17a1c70b5c..67331ffd05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ENHANCEMENTS: * Exclude recovery service vaults from e2e tests ([#4920](https://github.com/microsoft/AzureTRE/issues/4920)) * Update API, CLI, and UI dependencies to address high-severity Dependabot alerts, including `PyJWT`, `Vite`, `lodash`, `fast-uri`, `flatted`, `immutable`, and `minimatch`. * Update dependencies to address Dependabot security alerts: `aiohttp` to 3.14.1, `Pygments` to 2.20.0, `esbuild`, `ws`, `js-yaml`, `@babel/core`, `flatted` (via vitest upgrade), and `react-router-dom`. ([#4950](https://github.com/microsoft/AzureTRE/issues/4950)) +* Added support for formatting UI code via `pre-commit` and fixed existing formatting issues. ([#4955](https://github.com/microsoft/AzureTRE/issues/4955)) BUG FIXES: * Fix UI TypeScript deprecation warning by updating `moduleResolution` to `bundler` in `tsconfig.json`. ([#4968](https://github.com/microsoft/AzureTRE/issues/4968)) diff --git a/ui/app/.prettierrc b/ui/app/.prettierrc index dc6958febb..c235684996 100644 --- a/ui/app/.prettierrc +++ b/ui/app/.prettierrc @@ -1,4 +1,6 @@ { "singleQuote": false, - "semi": true + "semi": true, + "trailingComma": "all", + "printWidth": 120 } From 48ad36d52e8ee5e04ae0f82c7ec3ccaf7ff2a710 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 15 Jul 2026 10:38:51 +0100 Subject: [PATCH 2/3] Updated the version of tre-ui due to .prettier update --- ui/app/package-lock.json | 4 ++-- ui/app/package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/app/package-lock.json b/ui/app/package-lock.json index 0cd4804273..6bd398dfa2 100644 --- a/ui/app/package-lock.json +++ b/ui/app/package-lock.json @@ -1,12 +1,12 @@ { "name": "tre-ui", - "version": "0.8.28", + "version": "0.8.29", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "tre-ui", - "version": "0.8.28", + "version": "0.8.29", "dependencies": { "@azure/msal-browser": "^2.35.0", "@azure/msal-react": "^1.5.12", diff --git a/ui/app/package.json b/ui/app/package.json index 883d5f9a9d..f76512d6d8 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.8.28", + "version": "0.8.29", "private": true, "type": "module", "dependencies": { @@ -88,4 +88,4 @@ "overrides": { "esbuild": "^0.28.1" } -} \ No newline at end of file +} From 54b1eb4af83213099896845462d168af91008e7d Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 15 Jul 2026 12:14:17 +0100 Subject: [PATCH 3/3] Updated the files filter for the prettier hook config --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1b5ed8b7ec..47bc4b385f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,4 +12,4 @@ repos: rev: v3.5.0 hooks: - id: prettier - files: ^ui/app + files: ^ui/app/