From 8e41b196c22ae86c41bd55c5f9cf92ea3e057eaa Mon Sep 17 00:00:00 2001 From: Matthew Kwong Date: Mon, 24 Feb 2025 09:43:15 +0800 Subject: [PATCH 1/3] chore: simplify Radix Themes import checking --- eslint.config.mjs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 6ecbe206..4a51939c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -15,9 +15,6 @@ const compat = new FlatCompat({ baseDirectory: import.meta.dirname, }); -const radixThemesRestrictedImportMessage = - 'Please use `import { } from "@radix-ui/themes/components/"`instead, to avoid unnecessary Radix dependencies being bundled to the client bundle, due to Next.js bundling behavior and Radix Themes now imports from `radix-ui` instead of `@radix-ui/`.'; - const config = tseslint.config( eslint.configs.recommended, tseslint.configs.strictTypeChecked, @@ -84,14 +81,11 @@ const config = tseslint.config( "@typescript-eslint/no-restricted-imports": [ "error", { - paths: [ - { - message: radixThemesRestrictedImportMessage, - name: "@radix-ui/themes", - }, + patterns: [ { - message: radixThemesRestrictedImportMessage, - name: "@radix-ui/themes/components/index", + regex: "^@radix-ui/themes(/components/index)?$", + message: + 'Please use `import { } from "@radix-ui/themes/components/"`instead, to avoid unnecessary Radix dependencies being bundled to the client bundle, due to Next.js bundling behavior and Radix Themes now imports from `radix-ui` instead of `@radix-ui/`.', }, ], }, From 936fd1754620d3a38396a1f1b7812adbacbbe4f5 Mon Sep 17 00:00:00 2001 From: Matthew Kwong <32725014+mwskwong@users.noreply.github.com> Date: Mon, 24 Feb 2025 10:39:52 +0800 Subject: [PATCH 2/3] chore: unlighthouse scan 3 times for a more accurate result --- unlighthouse.config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unlighthouse.config.ts b/unlighthouse.config.ts index be72261b..3f566423 100644 --- a/unlighthouse.config.ts +++ b/unlighthouse.config.ts @@ -23,6 +23,9 @@ const config = { extraHeaders: { "x-vercel-protection-bypass": process.env.VERCEL_AUTOMATION_BYPASS_SECRET, }, + scanner: { + samples: 3 + }, lighthouseOptions: { throttling: { cpuSlowdownMultiplier: 8.6, // matches GitHub Action Ubuntu performance From 34b149333c0488c977774ac2028b5876f7619711 Mon Sep 17 00:00:00 2001 From: Matthew Kwong <32725014+mwskwong@users.noreply.github.com> Date: Mon, 24 Feb 2025 11:08:52 +0800 Subject: [PATCH 3/3] chore: format value --- unlighthouse.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unlighthouse.config.ts b/unlighthouse.config.ts index 3f566423..3844dbd8 100644 --- a/unlighthouse.config.ts +++ b/unlighthouse.config.ts @@ -24,7 +24,7 @@ const config = { "x-vercel-protection-bypass": process.env.VERCEL_AUTOMATION_BYPASS_SECRET, }, scanner: { - samples: 3 + samples: 3, }, lighthouseOptions: { throttling: {