From 647184be4f7794dcf7a3c762bf5095ab229142a5 Mon Sep 17 00:00:00 2001 From: zach-betz-hln Date: Wed, 6 Aug 2025 09:03:23 -0500 Subject: [PATCH] upgrade biome --- api/biome.json | 4 +- api/src/jwtUtils.ts | 2 +- biome.json | 41 +++++------ package-lock.json | 73 +++++++++---------- package.json | 2 +- react/biome.json | 4 +- react/src/components/Alert.tsx | 13 +++- react/src/components/ProtectedApp.tsx | 6 +- .../routes/Playground/Playground.tsx | 2 +- .../routes/Playground/WithToken.tsx | 2 +- .../routes/Playground/WithoutToken.tsx | 2 +- react/src/config.ts | 3 - react/vite.config.ts | 4 +- 13 files changed, 76 insertions(+), 82 deletions(-) diff --git a/api/biome.json b/api/biome.json index 03ae7f1..0ae4021 100644 --- a/api/biome.json +++ b/api/biome.json @@ -1,4 +1,4 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", - "extends": ["../biome.json"] + "root": false, + "extends": "//" } diff --git a/api/src/jwtUtils.ts b/api/src/jwtUtils.ts index 380683a..119583c 100644 --- a/api/src/jwtUtils.ts +++ b/api/src/jwtUtils.ts @@ -1,5 +1,5 @@ import type { NextFunction, Request, Response } from 'express'; -import { type JWTVerifyGetKey, createRemoteJWKSet, jwtVerify } from 'jose'; +import { createRemoteJWKSet, type JWTVerifyGetKey, jwtVerify } from 'jose'; import { requireEnvVar } from './envUtils.js'; import type { AugmentedRequest } from './types.js'; diff --git a/biome.json b/biome.json index a4d653a..028ca5f 100644 --- a/biome.json +++ b/biome.json @@ -1,45 +1,38 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "$schema": "https://biomejs.dev/schemas/2.0.6/schema.json", "vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true }, "files": { - "ignore": ["**/node_modules/**", "**/dist/**"] + "includes": ["**", "!**/node_modules/**", "!**/dist/**"] }, - "organizeImports": { - "enabled": true - }, - "linter": { - "enabled": true, - "rules": { - "all": true, - "complexity": { - "noVoid": "off" - }, - "correctness": { - "noNodejsModules": "off", - "noUndeclaredDependencies": "off" - }, - "suspicious": { - "noConsole": "off", - "noConsoleLog": "off" + "assist": { + "actions": { + "source": { + "recommended": true } } }, "formatter": { - "enabled": true, + "formatWithErrors": true, "lineWidth": 120, - "indentStyle": "space", - "indentWidth": 2 + "indentStyle": "space" + }, + "linter": { + "domains": { + "project": "all", + "react": "all", + "test": "all" + }, + "rules": {} }, "javascript": { "formatter": { "quoteStyle": "single", "trailingCommas": "all" - }, - "globals": ["React"] + } }, "css": { "formatter": { diff --git a/package-lock.json b/package-lock.json index fc5d302..b4e446a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,16 +7,15 @@ "": { "version": "2.1.1", "devDependencies": { - "@biomejs/biome": "^1.9.4", + "@biomejs/biome": "2.0.6", "markdown-toc": "^1.2.0" } }, "node_modules/@biomejs/biome": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz", - "integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.0.6.tgz", + "integrity": "sha512-RRP+9cdh5qwe2t0gORwXaa27oTOiQRQvrFf49x2PA1tnpsyU7FIHX4ZOFMtBC4QNtyWsN7Dqkf5EDbg4X+9iqA==", "dev": true, - "hasInstallScript": true, "license": "MIT OR Apache-2.0", "bin": { "biome": "bin/biome" @@ -29,20 +28,20 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "1.9.4", - "@biomejs/cli-darwin-x64": "1.9.4", - "@biomejs/cli-linux-arm64": "1.9.4", - "@biomejs/cli-linux-arm64-musl": "1.9.4", - "@biomejs/cli-linux-x64": "1.9.4", - "@biomejs/cli-linux-x64-musl": "1.9.4", - "@biomejs/cli-win32-arm64": "1.9.4", - "@biomejs/cli-win32-x64": "1.9.4" + "@biomejs/cli-darwin-arm64": "2.0.6", + "@biomejs/cli-darwin-x64": "2.0.6", + "@biomejs/cli-linux-arm64": "2.0.6", + "@biomejs/cli-linux-arm64-musl": "2.0.6", + "@biomejs/cli-linux-x64": "2.0.6", + "@biomejs/cli-linux-x64-musl": "2.0.6", + "@biomejs/cli-win32-arm64": "2.0.6", + "@biomejs/cli-win32-x64": "2.0.6" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz", - "integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.0.6.tgz", + "integrity": "sha512-AzdiNNjNzsE6LfqWyBvcL29uWoIuZUkndu+wwlXW13EKcBHbbKjNQEZIJKYDc6IL+p7bmWGx3v9ZtcRyIoIz5A==", "cpu": [ "arm64" ], @@ -57,9 +56,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz", - "integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.0.6.tgz", + "integrity": "sha512-wJjjP4E7bO4WJmiQaLnsdXMa516dbtC6542qeRkyJg0MqMXP0fvs4gdsHhZ7p9XWTAmGIjZHFKXdsjBvKGIJJQ==", "cpu": [ "x64" ], @@ -74,9 +73,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz", - "integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.0.6.tgz", + "integrity": "sha512-ZSVf6TYo5rNMUHIW1tww+rs/krol7U5A1Is/yzWyHVZguuB0lBnIodqyFuwCNqG9aJGyk7xIMS8HG0qGUPz0SA==", "cpu": [ "arm64" ], @@ -91,9 +90,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz", - "integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.0.6.tgz", + "integrity": "sha512-CVPEMlin3bW49sBqLBg2x016Pws7eUXA27XYDFlEtponD0luYjg2zQaMJ2nOqlkKG9fqzzkamdYxHdMDc2gZFw==", "cpu": [ "arm64" ], @@ -108,9 +107,9 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz", - "integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.0.6.tgz", + "integrity": "sha512-geM1MkHTV1Kh2Cs/Xzot9BOF3WBacihw6bkEmxkz4nSga8B9/hWy5BDiOG3gHDGIBa8WxT0nzsJs2f/hPqQIQw==", "cpu": [ "x64" ], @@ -125,9 +124,9 @@ } }, "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz", - "integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.0.6.tgz", + "integrity": "sha512-mKHE/e954hR/hSnAcJSjkf4xGqZc/53Kh39HVW1EgO5iFi0JutTN07TSjEMg616julRtfSNJi0KNyxvc30Y4rQ==", "cpu": [ "x64" ], @@ -142,9 +141,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz", - "integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.0.6.tgz", + "integrity": "sha512-290V4oSFoKaprKE1zkYVsDfAdn0An5DowZ+GIABgjoq1ndhvNxkJcpxPsiYtT7slbVe3xmlT0ncdfOsN7KruzA==", "cpu": [ "arm64" ], @@ -159,9 +158,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz", - "integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.0.6.tgz", + "integrity": "sha512-bfM1Bce0d69Ao7pjTjUS+AWSZ02+5UHdiAP85Th8e9yV5xzw6JrHXbL5YWlcEKQ84FIZMdDc7ncuti1wd2sdbw==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index c941b3e..3e2b2da 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "docker-compose-all": "cp .env.sample .env && docker compose build && docker compose up" }, "devDependencies": { - "@biomejs/biome": "^1.9.4", + "@biomejs/biome": "2.0.6", "markdown-toc": "^1.2.0" } } diff --git a/react/biome.json b/react/biome.json index 03ae7f1..0ae4021 100644 --- a/react/biome.json +++ b/react/biome.json @@ -1,4 +1,4 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", - "extends": ["../biome.json"] + "root": false, + "extends": "//" } diff --git a/react/src/components/Alert.tsx b/react/src/components/Alert.tsx index 7f6e4ac..522dd03 100644 --- a/react/src/components/Alert.tsx +++ b/react/src/components/Alert.tsx @@ -21,5 +21,16 @@ export const Alert: FC = (props) => { color = 'rgb(95, 33, 32)'; } - return
{children}
; + return ( +
+ {children} +
+ ); }; diff --git a/react/src/components/ProtectedApp.tsx b/react/src/components/ProtectedApp.tsx index a1176d2..fd11f09 100644 --- a/react/src/components/ProtectedApp.tsx +++ b/react/src/components/ProtectedApp.tsx @@ -46,11 +46,7 @@ export const ProtectedApp: FC = (props) => { const anyErrorMessage = getAuthHealthError?.message || auth.error?.message; if (anyLoading) { - return ( - <> -

Loading...

- - ); + return

Loading...

; } if (anyErrorMessage) { return ( diff --git a/react/src/components/routes/Playground/Playground.tsx b/react/src/components/routes/Playground/Playground.tsx index ae13eb7..d7a7b17 100644 --- a/react/src/components/routes/Playground/Playground.tsx +++ b/react/src/components/routes/Playground/Playground.tsx @@ -1,6 +1,6 @@ import type { FC } from 'react'; -import { WithToken } from './WithToken.tsx'; import { WithoutToken } from './WithoutToken.tsx'; +import { WithToken } from './WithToken.tsx'; export const Playground: FC = () => { return ( diff --git a/react/src/components/routes/Playground/WithToken.tsx b/react/src/components/routes/Playground/WithToken.tsx index e0e3c11..9ac0a75 100644 --- a/react/src/components/routes/Playground/WithToken.tsx +++ b/react/src/components/routes/Playground/WithToken.tsx @@ -35,7 +35,7 @@ export const WithToken: FC = () => { return error ? ( {error.message} ) : isPending ? ( - <>Loading... +
Loading...
) : ( {JSON.stringify(data, null, 2)} ); diff --git a/react/src/components/routes/Playground/WithoutToken.tsx b/react/src/components/routes/Playground/WithoutToken.tsx index 6e614c7..2b697e8 100644 --- a/react/src/components/routes/Playground/WithoutToken.tsx +++ b/react/src/components/routes/Playground/WithoutToken.tsx @@ -28,7 +28,7 @@ export const WithoutToken: FC = () => { return error ? ( {error.message} ) : isPending ? ( - <>Loading... +
Loading...
) : ( {JSON.stringify(data, null, 2)} ); diff --git a/react/src/config.ts b/react/src/config.ts index be186d0..f5df700 100644 --- a/react/src/config.ts +++ b/react/src/config.ts @@ -3,11 +3,8 @@ import { UserManager, WebStorageStateStore } from 'oidc-client-ts'; export const userManager = new UserManager({ authority: import.meta.env.VITE_AUTHORITY, - // biome-ignore lint/style/useNamingConvention: Expected client_id: import.meta.env.VITE_CLIENT_ID, - // biome-ignore lint/style/useNamingConvention: Expected redirect_uri: `${window.location.origin}${window.location.pathname}`, - // biome-ignore lint/style/useNamingConvention: Expected post_logout_redirect_uri: window.location.origin, userStore: new WebStorageStateStore({ store: window.sessionStorage }), monitorSession: true, // this allows cross tab login/logout detection diff --git a/react/vite.config.ts b/react/vite.config.ts index 28f5618..4ffacdd 100644 --- a/react/vite.config.ts +++ b/react/vite.config.ts @@ -1,8 +1,7 @@ import react from '@vitejs/plugin-react'; -import { type UserConfigExport, defineConfig, loadEnv } from 'vite'; +import { defineConfig, loadEnv, type UserConfigExport } from 'vite'; // https://vitejs.dev/config/ -// biome-ignore lint/style/noDefaultExport: Expected export default defineConfig(({ command, mode }) => { const env = loadEnv(mode, process.cwd()); @@ -23,7 +22,6 @@ export default defineConfig(({ command, mode }) => { target: env.VITE_API_BASE_URL, changeOrigin: true, rewrite: (path) => { - // biome-ignore lint/performance/useTopLevelRegex: We accept the perf hit return path.replace(/^\/api/, ''); }, },