From a0baa8266ba1768ade9b024f3a6bdb9adb71b630 Mon Sep 17 00:00:00 2001 From: yangsisi <13655750+yangsisi0422@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:24:23 +0800 Subject: [PATCH] fix(defineConfig): fix type issue passing custom property in the second config param in defineConfig function To fix TS error: Object literal may only specify known properties, and customOption does not exist in type When playwright.config.ts as follow: ``` type Options = { customOption: any[] } export default defineConfig(BasePlaywrightConfig, { use: { customOption, }, }) ``` Signed-off-by: yangsisi <13655750+yangsisi0422@users.noreply.github.com> --- packages/playwright/types/test.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index 8d05bdafef..1b999da11b 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -7487,7 +7487,7 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; export function defineConfig(config: PlaywrightTestConfig, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig; -export function defineConfig(config: PlaywrightTestConfig, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig; +export function defineConfig(config: PlaywrightTestConfig, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig; export function defineConfig(config: PlaywrightTestConfig, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig; type MergedT = List extends [TestType, ...(infer Rest)] ? T & MergedT : {};