Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: migrate to TypeScript 6.0 (#40429)
Pavel Feldman7ab999186f84
diff --git a/eslint.config.mjs b/eslint.config.mjsindex cacd6c16c1..8a852e3f0e 100644--- a/eslint.config.mjs+++ b/eslint.config.mjs@@ -499,6 +499,29 @@ export default [...noFloatingPromisesRules,},},+ {+ files: ["packages/extension/src/**/*.ts", "packages/extension/src/**/*.tsx"],+ ignores: ["packages/extension/src/ui/**"],+ languageOptions: {+ parser: tsParser,+ ecmaVersion: 9,+ sourceType: "module",+ parserOptions: {+ project: path.join(__dirname, "packages", "extension", "tsconfig.json"),+ },+ },+ },+ {+ files: ["packages/extension/src/ui/**/*.ts", "packages/extension/src/ui/**/*.tsx"],+ languageOptions: {+ parser: tsParser,+ ecmaVersion: 9,+ sourceType: "module",+ parserOptions: {+ project: path.join(__dirname, "packages", "extension", "tsconfig.ui.json"),+ },+ },+ },...reactBaseConfig.map((config) => ({...config,files: reactFiles,diff --git a/package-lock.json b/package-lock.jsonindex 0ccdeefba1..3abad98229 100644--- a/package-lock.json+++ b/package-lock.json@@ -68,9 +68,9 @@"@types/xml2js": "^0.4.9","@types/yauzl": "^2.10.3","@types/yazl": "^2.4.2",- "@typescript-eslint/eslint-plugin": "^8.41.0",- "@typescript-eslint/parser": "^8.41.0",- "@typescript-eslint/utils": "^8.41.0",+ "@typescript-eslint/eslint-plugin": "^8.59.0",+ "@typescript-eslint/parser": "^8.59.0",+ "@typescript-eslint/utils": "^8.59.0","@vitejs/plugin-basic-ssl": "^1.1.0","@vitejs/plugin-react": "^4.2.1","@zip.js/zip.js": "^2.7.29",@@ -115,7 +115,7 @@"socks-proxy-agent": "8.0.5","source-map-support": "0.5.21","ssim.js": "^3.5.0",- "typescript": "^5.9.2",+ "typescript": "^6.0.3","vite": "^6.4.1","vite-plugin-static-copy": "^3.1.1","ws": "8.17.1",@@ -2840,20 +2840,20 @@}},"node_modules/@typescript-eslint/eslint-plugin": {- "version": "8.56.1",- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.56.1.tgz",- "integrity": "sha512-Jz9ZztpB37dNC+HU2HI28Bs9QXpzCz+y/twHOwhyrIRdbuVDxSytJNDl6z/aAKlaRIwC7y8wJdkBv7FxYGgi0A==",+ "version": "8.59.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.59.0.tgz",+ "integrity": "sha512-HyAZtpdkgZwpq8Sz3FSUvCR4c+ScbuWa9AksK2Jweub7w4M3yTz4O11AqVJzLYjy/B9ZWPyc81I+mOdJU/bDQw==","dev": true,"license": "MIT","dependencies": {"@eslint-community/regexpp": "^4.12.2",- "@typescript-eslint/scope-manager": "8.56.1",- "@typescript-eslint/type-utils": "8.56.1",- "@typescript-eslint/utils": "8.56.1",- "@typescript-eslint/visitor-keys": "8.56.1",+ "@typescript-eslint/scope-manager": "8.59.0",+ "@typescript-eslint/type-utils": "8.59.0",+ "@typescript-eslint/utils": "8.59.0",+ "@typescript-eslint/visitor-keys": "8.59.0","ignore": "^7.0.5","natural-compare": "^1.4.0",- "ts-api-utils": "^2.4.0"+ "ts-api-utils": "^2.5.0"},"engines": {"node": "^18.18.0 || ^20.9.0 || >=21.1.0"@@ -2863,9 +2863,9 @@"url": "https://opencollective.com/typescript-eslint"},"peerDependencies": {- "@typescript-eslint/parser": "^8.56.1",+ "@typescript-eslint/parser": "^8.59.0","eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",- "typescript": ">=4.8.4 <6.0.0"+ "typescript": ">=4.8.4 <6.1.0"}},"node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {@@ -2878,16 +2878,16 @@}},"node_modules/@typescript-eslint/parser": {- "version": "8.56.1",- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.56.1.tgz",- "integrity": "sha512-klQbnPAAiGYFyI02+znpBRLyjL4/BrBd0nyWkdC0s/6xFLkXYQ8OoRrSkqacS1ddVxf/LDyODIKbQ5TgKAf/Fg==",+ "version": "8.59.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.59.0.tgz",+ "integrity": "sha512-TI1XGwKbDpo9tRW8UDIXCOeLk55qe9ZFGs8MTKU6/M08HWTw52DD/IYhfQtOEhEdPhLMT26Ka/x7p70nd3dzDg==","dev": true,"license": "MIT","dependencies": {- "@typescript-eslint/scope-manager": "8.56.1",- "@typescript-eslint/types": "8.56.1",- "@typescript-eslint/typescript-estree": "8.56.1",- "@typescript-eslint/visitor-keys": "8.56.1",+ "@typescript-eslint/scope-manager": "8.59.0",+ "@typescript-eslint/types": "8.59.0",+ "@typescript-eslint/typescript-estree": "8.59.0",+ "@typescript-eslint/visitor-keys": "8.59.0","debug": "^4.4.3"},"engines": {@@ -2899,18 +2899,18 @@},"peerDependencies": {"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",- "typescript": ">=4.8.4 <6.0.0"+ "typescript": ">=4.8.4 <6.1.0"}},"node_modules/@typescript-eslint/project-service": {- "version": "8.56.1",- "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.56.1.tgz",- "integrity": "sha512-TAdqQTzHNNvlVFfR+hu2PDJrURiwKsUvxFn1M0h95BB8ah5jejas08jUWG4dBA68jDMI988IvtfdAI53JzEHOQ==",+ "version": "8.59.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.0.tgz",+ "integrity": "sha512-Lw5ITrR5s5TbC19YSvlr63ZfLaJoU6vtKTHyB0GQOpX0W7d5/Ir6vUahWi/8Sps/nOukZQ0IB3SmlxZnjaKVnw==","dev": true,"license": "MIT","dependencies": {- "@typescript-eslint/tsconfig-utils": "^8.56.1",- "@typescript-eslint/types": "^8.56.1",+ "@typescript-eslint/tsconfig-utils": "^8.59.0",+ "@typescript-eslint/types": "^8.59.0","debug": "^4.4.3"},"engines": {@@ -2921,18 +2921,18 @@"url": "https://opencollective.com/typescript-eslint"},"peerDependencies": {- "typescript": ">=4.8.4 <6.0.0"+ "typescript": ">=4.8.4 <6.1.0"}},"node_modules/@typescript-eslint/scope-manager": {- "version": "8.56.1",- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.56.1.tgz",- "integrity": "sha512-YAi4VDKcIZp0O4tz/haYKhmIDZFEUPOreKbfdAN3SzUDMcPhJ8QI99xQXqX+HoUVq8cs85eRKnD+rne2UAnj2w==",+ "version": "8.59.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.0.tgz",+ "integrity": "sha512-UzR16Ut8IpA3Mc4DbgAShlPPkVm8xXMWafXxB0BocaVRHs8ZGakAxGRskF7FId3sdk9lgGD73GSFaWmWFDE4dg==","dev": true,"license": "MIT","dependencies": {- "@typescript-eslint/types": "8.56.1",- "@typescript-eslint/visitor-keys": "8.56.1"+ "@typescript-eslint/types": "8.59.0",+ "@typescript-eslint/visitor-keys": "8.59.0"},"engines": {"node": "^18.18.0 || ^20.9.0 || >=21.1.0"@@ -2943,9 +2943,9 @@}},"node_modules/@typescript-eslint/tsconfig-utils": {- "version": "8.56.1",- "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.56.1.tgz",- "integrity": "sha512-qOtCYzKEeyr3aR9f28mPJqBty7+DBqsdd63eO0yyDwc6vgThj2UjWfJIcsFeSucYydqcuudMOprZ+x1SpF3ZuQ==",+ "version": "8.59.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.0.tgz",+ "integrity": "sha512-91Sbl3s4Kb3SybliIY6muFBmHVv+pYXfybC4Oolp3dvk8BvIE3wOPc+403CWIT7mJNkfQRGtdqghzs2+Z91Tqg==","dev": true,"license": "MIT","engines": {@@ -2956,21 +2956,21 @@"url": "https://opencollective.com/typescript-eslint"},"peerDependencies": {- "typescript": ">=4.8.4 <6.0.0"+ "typescript": ">=4.8.4 <6.1.0"}},"node_modules/@typescript-eslint/type-utils": {- "version": "8.56.1",- "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.56.1.tgz",- "integrity": "sha512-yB/7dxi7MgTtGhZdaHCemf7PuwrHMenHjmzgUW1aJpO+bBU43OycnM3Wn+DdvDO/8zzA9HlhaJ0AUGuvri4oGg==",+ "version": "8.59.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.59.0.tgz",+ "integrity": "sha512-3TRiZaQSltGqGeNrJzzr1+8YcEobKH9rHnqIp/1psfKFmhRQDNMGP5hBufanYTGznwShzVLs3Mz+gDN7HkWfXg==","dev": true,"license": "MIT","dependencies": {- "@typescript-eslint/types": "8.56.1",- "@typescript-eslint/typescript-estree": "8.56.1",- "@typescript-eslint/utils": "8.56.1",+ "@typescript-eslint/types": "8.59.0",+ "@typescript-eslint/typescript-estree": "8.59.0",+ "@typescript-eslint/utils": "8.59.0","debug": "^4.4.3",- "ts-api-utils": "^2.4.0"+ "ts-api-utils": "^2.5.0"},"engines": {"node": "^18.18.0 || ^20.9.0 || >=21.1.0"@@ -2981,13 +2981,13 @@},"peerDependencies": {"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",- "typescript": ">=4.8.4 <6.0.0"+ "typescript": ">=4.8.4 <6.1.0"}},"node_modules/@typescript-eslint/types": {- "version": "8.56.1",- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.56.1.tgz",- "integrity": "sha512-dbMkdIUkIkchgGDIv7KLUpa0Mda4IYjo4IAMJUZ+3xNoUXxMsk9YtKpTHSChRS85o+H9ftm51gsK1dZReY9CVw==",+ "version": "8.59.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.0.tgz",+ "integrity": "sha512-nLzdsT1gdOgFxxxwrlNVUBzSNBEEHJ86bblmk4QAS6stfig7rcJzWKqCyxFy3YRRHXDWEkb2NralA1nOYkkm/A==","dev": true,"license": "MIT","engines": {@@ -2999,21 +2999,21 @@}},"node_modules/@typescript-eslint/typescript-estree": {- "version": "8.56.1",- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.56.1.tgz",- "integrity": "sha512-qzUL1qgalIvKWAf9C1HpvBjif+Vm6rcT5wZd4VoMb9+Km3iS3Cv9DY6dMRMDtPnwRAFyAi7YXJpTIEXLvdfPxg==",+ "version": "8.59.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.0.tgz",+ "integrity": "sha512-O9Re9P1BmBLFJyikRbQpLku/QA3/AueZNO9WePLBwQrvkixTmDe8u76B6CYUAITRl/rHawggEqUGn5QIkVRLMw==","dev": true,"license": "MIT","dependencies": {- "@typescript-eslint/project-service": "8.56.1",- "@typescript-eslint/tsconfig-utils": "8.56.1",- "@typescript-eslint/types": "8.56.1",- "@typescript-eslint/visitor-keys": "8.56.1",+ "@typescript-eslint/project-service": "8.59.0",+ "@typescript-eslint/tsconfig-utils": "8.59.0",+ "@typescript-eslint/types": "8.59.0",+ "@typescript-eslint/visitor-keys": "8.59.0","debug": "^4.4.3","minimatch": "^10.2.2","semver": "^7.7.3","tinyglobby": "^0.2.15",- "ts-api-utils": "^2.4.0"+ "ts-api-utils": "^2.5.0"},"engines": {"node": "^18.18.0 || ^20.9.0 || >=21.1.0"@@ -3023,7 +3023,7 @@"url": "https://opencollective.com/typescript-eslint"},"peerDependencies": {- "typescript": ">=4.8.4 <6.0.0"+ "typescript": ">=4.8.4 <6.1.0"}},"node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": {@@ -3037,9 +3037,9 @@}},"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {- "version": "5.0.3",- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz",- "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==",+ "version": "5.0.5",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz",+ "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==","dev": true,"license": "MIT","dependencies": {@@ -3050,13 +3050,13 @@}},"node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {- "version": "10.2.4",- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz",- "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==",+ "version": "10.2.5",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz",+ "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==","dev": true,"license": "BlueOak-1.0.0","dependencies": {- "brace-expansion": "^5.0.2"+ "brace-expansion": "^5.0.5"},"engines": {"node": "18 || 20 || >=22"@@ -3066,16 +3066,16 @@}},"node_modules/@typescript-eslint/utils": {- "version": "8.56.1",- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.56.1.tgz",- "integrity": "sha512-HPAVNIME3tABJ61siYlHzSWCGtOoeP2RTIaHXFMPqjrQKCGB9OgUVdiNgH7TJS2JNIQ5qQ4RsAUDuGaGme/KOA==",+ "version": "8.59.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.0.tgz",+ "integrity": "sha512-I1R/K7V07XsMJ12Oaxg/O9GfrysGTmCRhvZJBv0RE0NcULMzjqVpR5kRRQjHsz3J/bElU7HwCO7zkqL+MSUz+g==","dev": true,"license": "MIT","dependencies": {"@eslint-community/eslint-utils": "^4.9.1",- "@typescript-eslint/scope-manager": "8.56.1",- "@typescript-eslint/types": "8.56.1",- "@typescript-eslint/typescript-estree": "8.56.1"+ "@typescript-eslint/scope-manager": "8.59.0",+ "@typescript-eslint/types": "8.59.0",+ "@typescript-eslint/typescript-estree": "8.59.0"},"engines": {"node": "^18.18.0 || ^20.9.0 || >=21.1.0"@@ -3086,17 +3086,17 @@},"peerDependencies": {"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",- "typescript": ">=4.8.4 <6.0.0"+ "typescript": ">=4.8.4 <6.1.0"}},"node_modules/@typescript-eslint/visitor-keys": {- "version": "8.56.1",- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.56.1.tgz",- "integrity": "sha512-KiROIzYdEV85YygXw6BI/Dx4fnBlFQu6Mq4QE4MOH9fFnhohw6wX/OAvDY2/C+ut0I3RSPKenvZJIVYqJNkhEw==",+ "version": "8.59.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.0.tgz",+ "integrity": "sha512-/uejZt4dSere1bx12WLlPfv8GktzcaDtuJ7s42/HEZ5zGj9oxRaD4bj7qwSunXkf+pbAhFt2zjpHYUiT5lHf0Q==","dev": true,"license": "MIT","dependencies": {- "@typescript-eslint/types": "8.56.1",+ "@typescript-eslint/types": "8.59.0","eslint-visitor-keys": "^5.0.0"},"engines": {@@ -8855,9 +8855,9 @@}},"node_modules/ts-api-utils": {- "version": "2.4.0",- "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz",- "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==",+ "version": "2.5.0",+ "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz",+ "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==","dev": true,"license": "MIT","engines": {@@ -9021,10 +9021,11 @@}},"node_modules/typescript": {- "version": "5.9.2",- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz",- "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",+ "version": "6.0.3",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz",+ "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==","devOptional": true,+ "license": "Apache-2.0","bin": {"tsc": "bin/tsc","tsserver": "bin/tsserver"diff --git a/package.json b/package.jsonindex 9620dea177..cc5f40bc8f 100644--- a/package.json+++ b/package.json@@ -110,9 +110,9 @@"@types/xml2js": "^0.4.9","@types/yauzl": "^2.10.3","@types/yazl": "^2.4.2",- "@typescript-eslint/eslint-plugin": "^8.41.0",- "@typescript-eslint/parser": "^8.41.0",- "@typescript-eslint/utils": "^8.41.0",+ "@typescript-eslint/eslint-plugin": "^8.59.0",+ "@typescript-eslint/parser": "^8.59.0",+ "@typescript-eslint/utils": "^8.59.0","@vitejs/plugin-basic-ssl": "^1.1.0","@vitejs/plugin-react": "^4.2.1","@zip.js/zip.js": "^2.7.29",@@ -157,7 +157,7 @@"socks-proxy-agent": "8.0.5","source-map-support": "0.5.21","ssim.js": "^3.5.0",- "typescript": "^5.9.2",+ "typescript": "^6.0.3","vite": "^6.4.1","vite-plugin-static-copy": "^3.1.1","ws": "8.17.1",diff --git a/packages/extension/tsconfig.json b/packages/extension/tsconfig.jsonindex 9c22b0bca0..b72c388b77 100644--- a/packages/extension/tsconfig.json+++ b/packages/extension/tsconfig.json@@ -11,7 +11,8 @@"types": ["chrome"],"jsx": "react-jsx","jsxImportSource": "react",- "noEmit": true+ "noEmit": true,+ "ignoreDeprecations": "6.0"},"include": ["src",diff --git a/packages/extension/tsconfig.ui.json b/packages/extension/tsconfig.ui.jsonindex f62dd8a3f7..539e9dbce7 100644--- a/packages/extension/tsconfig.ui.json+++ b/packages/extension/tsconfig.ui.json@@ -12,6 +12,8 @@"jsx": "react-jsx","jsxImportSource": "react","noEmit": true,+ "ignoreDeprecations": "6.0",+ "noUncheckedSideEffectImports": false,},"include": ["src/ui",diff --git a/packages/injected/src/webSocketMock.ts b/packages/injected/src/webSocketMock.tsindex 9285dea5dc..3d04bc9b42 100644--- a/packages/injected/src/webSocketMock.ts+++ b/packages/injected/src/webSocketMock.ts@@ -14,7 +14,7 @@* limitations under the License.*/-export type WebSocketMessage = string | ArrayBufferLike | Blob | ArrayBufferView;+export type WebSocketMessage = string | ArrayBuffer | Blob | ArrayBufferView<ArrayBuffer>;export type WSData = { data: string, isBase64: boolean };export type OnCreatePayload = { type: 'onCreate', id: string, url: string, protocols: string[] };@@ -360,5 +360,5 @@ export function inject(globalThis: GlobalThis) {idToWebSocket.delete(this._id);}}- globalThis.WebSocket = class WebSocket extends WebSocketMock {};+ globalThis.WebSocket = class WebSocket extends WebSocketMock {} as typeof globalThis.WebSocket;}diff --git a/packages/isomorphic/trace/snapshotRenderer.ts b/packages/isomorphic/trace/snapshotRenderer.tsindex 62ad3aaad6..72bf324bb5 100644--- a/packages/isomorphic/trace/snapshotRenderer.ts+++ b/packages/isomorphic/trace/snapshotRenderer.ts@@ -283,7 +283,7 @@ function snapshotScript(viewport: ViewportSize, ...targetIds: (string | undefine// which will eventually trigger the same process inside the iframe recursively.// When there's a canvas to render, we iterate over its ancestor frames to compute// its position relative to the top snapshot frame.- const frameBoundingRectsInfo = {+ const frameBoundingRectsInfo: FrameBoundingRectsInfo = {viewport,frames: new WeakMap(),};diff --git a/packages/playwright-client/types/types.d.ts b/packages/playwright-client/types/types.d.tsindex 6f688c7191..05fb9e1ed8 100644--- a/packages/playwright-client/types/types.d.ts+++ b/packages/playwright-client/types/types.d.ts@@ -22,7 +22,7 @@ import { Serializable, EvaluationArgument, PageFunction, PageFunctionOn, SmartHa// Use the global URLPattern type if available (Node.js 22+, modern browsers),// otherwise fall back to `never` so it disappears from union types.-type URLPattern = typeof globalThis extends { URLPattern: infer T } ? T : never;+type URLPattern = typeof globalThis extends { URLPattern: new (...args: any) => infer T } ? T : never;type PageWaitForSelectorOptionsNotHidden = PageWaitForSelectorOptions & {state?: 'visible'|'attached';diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.tsindex 6f688c7191..05fb9e1ed8 100644--- a/packages/playwright-core/types/types.d.ts+++ b/packages/playwright-core/types/types.d.ts@@ -22,7 +22,7 @@ import { Serializable, EvaluationArgument, PageFunction, PageFunctionOn, SmartHa// Use the global URLPattern type if available (Node.js 22+, modern browsers),// otherwise fall back to `never` so it disappears from union types.-type URLPattern = typeof globalThis extends { URLPattern: infer T } ? T : never;+type URLPattern = typeof globalThis extends { URLPattern: new (...args: any) => infer T } ? T : never;type PageWaitForSelectorOptionsNotHidden = PageWaitForSelectorOptions & {state?: 'visible'|'attached';diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.tsindex 08de776f0e..d0b1557c0b 100644--- a/packages/playwright/types/test.d.ts+++ b/packages/playwright/types/test.d.ts@@ -7742,7 +7742,7 @@ export type PlaywrightTestConfig<TestArgs = {}, WorkerArgs = {}> = Config<Playwr// Use the global URLPattern type if available (Node.js 22+, modern browsers),// otherwise fall back to `never` so it disappears from union types.-type URLPattern = typeof globalThis extends { URLPattern: infer T } ? T : never;+type URLPattern = typeof globalThis extends { URLPattern: new (...args: any) => infer T } ? T : never;type AsymmetricMatcher = Record<string, any>;interface AsymmetricMatchers {diff --git a/tests/components/ct-vue-cli/tsconfig.test.json b/tests/components/ct-vue-cli/tsconfig.test.jsonindex a1c8da993c..910c087fca 100644--- a/tests/components/ct-vue-cli/tsconfig.test.json+++ b/tests/components/ct-vue-cli/tsconfig.test.json@@ -7,6 +7,7 @@"lib": [],"jsx": "react-jsx","types": ["node"],- "ignoreDeprecations": "5.0"+ "noUncheckedSideEffectImports": false,+ "ignoreDeprecations": "6.0"}}diff --git a/tests/config/testserver/index.ts b/tests/config/testserver/index.tsindex a46ceb85f7..624d2f690f 100644--- a/tests/config/testserver/index.ts+++ b/tests/config/testserver/index.ts@@ -38,6 +38,8 @@ type UpgradeActions = {socket: stream.Duplex;};+type IncomingMessageWithBody = http.IncomingMessage & { postBody: Promise<Buffer> };+export class TestServer {private _server: http.Server;private _wsServer: WebSocketServer;@@ -45,7 +47,7 @@ export class TestServer {readonly debugServer: any;private _startTime: Date;private _cachedPathPrefix: string | null;- private _routes = new Map<string, (arg0: http.IncomingMessage, arg1: http.ServerResponse) => any>();+ private _routes = new Map<string, (arg0: IncomingMessageWithBody, arg1: http.ServerResponse) => any>();private _auths = new Map<string, { username: string; password: string; }>();private _csp = new Map<string, string>();private _extraHeaders = new Map<string, object>();@@ -180,7 +182,7 @@ export class TestServer {});}- setRoute(path: string, handler: (arg0: http.IncomingMessage & { postBody: Promise<Buffer> }, arg1: http.ServerResponse) => any) {+ setRoute(path: string, handler: (arg0: IncomingMessageWithBody, arg1: http.ServerResponse) => any) {this._routes.set(path, handler);}@@ -192,7 +194,7 @@ export class TestServer {});}- waitForRequest(path: string): Promise<http.IncomingMessage & { postBody: Promise<Buffer> }> {+ waitForRequest(path: string): Promise<IncomingMessageWithBody> {let promise = this._requestSubscribers.get(path);if (promise)return promise;@@ -259,7 +261,7 @@ export class TestServer {}const handler = this._routes.get(pathWithSearch);if (handler)- handler.call(null, request, response);+ handler.call(null, request as IncomingMessageWithBody, response);elsethis.serveFile(request, response);}diff --git a/tests/installation/playwright-test-plugin/tsconfig.json b/tests/installation/playwright-test-plugin/tsconfig.jsonindex d91382771e..40e56ed2a3 100644--- a/tests/installation/playwright-test-plugin/tsconfig.json+++ b/tests/installation/playwright-test-plugin/tsconfig.json@@ -3,6 +3,7 @@"target": "ES2019","module": "commonjs","lib": ["esnext", "dom", "DOM.Iterable"],+ "types": ["node"],"esModuleInterop": true,"strict": true,"allowJs": false,diff --git a/tests/library/locator-dispatchevent-touch.spec.ts b/tests/library/locator-dispatchevent-touch.spec.tsindex fdf9c2c7e2..1e3cdf08e0 100644--- a/tests/library/locator-dispatchevent-touch.spec.ts+++ b/tests/library/locator-dispatchevent-touch.spec.ts@@ -25,7 +25,7 @@ it('should support touch points in touch event arguments', async ({ page, server<div data-testid='inner' style="position: absolute; width: 100px; height: 100px; top: 10px; left: 10px; background-color: green; z-index: 3;">inner</div></div>`);const outer = page.getByTestId('outer');- await outer.evaluate(el => {+ await outer.evaluate((el: HTMLElement) => {const events = [];(window as any).events = events;el.addEventListener('touchstart', (e: TouchEvent) => events.push('touchstart: ' + [...e.touches].map(t => `${t.constructor.name}(id: ${t.identifier}, clientX: ${t.clientX}, clientY: ${t.clientY})`)));diff --git a/tests/library/unit/clock.spec.ts b/tests/library/unit/clock.spec.tsindex 64e87cf00a..e4acdc5480 100644--- a/tests/library/unit/clock.spec.ts+++ b/tests/library/unit/clock.spec.ts@@ -1760,7 +1760,7 @@ interface Stub {const createStub = (body?: () => void): Stub => {const allFirstArgs = new Set<any>();- const stub: Stub = function(...args: any[]) {+ const stub: Stub = function(this: any, ...args: any[]) {stub.calls.push({ receiver: this, args, time: process.hrtime.bigint() });allFirstArgs.add(args[0]);if (body)diff --git a/tests/page/page-drag.spec.ts b/tests/page/page-drag.spec.tsindex a13edbcf12..66fb9e6347 100644--- a/tests/page/page-drag.spec.ts+++ b/tests/page/page-drag.spec.ts@@ -434,12 +434,13 @@ async function trackEvents(target: ElementHandle) {'dragstart', 'dragend', 'dragover', 'dragenter', 'dragleave', 'dragexit','drop']) {- target.addEventListener(event, (e: PointerEvent) => {+ target.addEventListener(event, e => {+ const pe = e as PointerEvent;// Browsers are all over the place with dragend position.if (event === 'dragend')events.push('dragend');else- events.push(`${event} at ${e.clientX};${e.clientY}`);+ events.push(`${event} at ${pe.clientX};${pe.clientY}`);}, false);}return events;diff --git a/tests/page/page-evaluate.spec.ts b/tests/page/page-evaluate.spec.tsindex b48e09bb5c..d4abcf54de 100644--- a/tests/page/page-evaluate.spec.ts+++ b/tests/page/page-evaluate.spec.ts@@ -621,7 +621,7 @@ it('should respect use strict expression', async ({ page }) => {});it('should not leak utility script', async function({ page }) {- expect(await page.evaluate(() => this === window)).toBe(true);+ expect(await page.evaluate('this === window')).toBe(true);});it('should not leak handles', async ({ page }) => {diff --git a/tests/page/wheel.spec.ts b/tests/page/wheel.spec.tsindex 4649277a8b..db3ec7e0b5 100644--- a/tests/page/wheel.spec.ts+++ b/tests/page/wheel.spec.ts@@ -199,7 +199,8 @@ it('should work when the event is canceled', async ({ page }) => {async function listenForWheelEvents(page: Page, selector: string) {await page.evaluate(selector => {- document.querySelector(selector).addEventListener('wheel', (e: WheelEvent) => {+ document.querySelector(selector).addEventListener('wheel', event => {+ const e = event as WheelEvent;window['lastEvent'] = {deltaX: e.deltaX,deltaY: e.deltaY,diff --git a/tests/page/workers.spec.ts b/tests/page/workers.spec.tsindex a2769860fb..617f376673 100644--- a/tests/page/workers.spec.ts+++ b/tests/page/workers.spec.ts@@ -41,7 +41,7 @@ it('should emit created and destroyed events', async function({ page }) {const workerCreatedPromise = page.waitForEvent('worker');const workerObj = await page.evaluateHandle(() => new Worker(URL.createObjectURL(new Blob(['1'], { type: 'application/javascript' }))));const worker = await workerCreatedPromise;- const workerThisObj = await worker.evaluateHandle(() => this);+ const workerThisObj = await worker.evaluateHandle('this');const workerDestroyedPromise = new Promise(x => worker.once('close', x));await page.evaluate(workerObj => workerObj.terminate(), workerObj);expect(await workerDestroyedPromise).toBe(worker);diff --git a/tests/playwright-test/expect.spec.ts b/tests/playwright-test/expect.spec.tsindex 1bc4540d4d..14da2c3681 100644--- a/tests/playwright-test/expect.spec.ts+++ b/tests/playwright-test/expect.spec.ts@@ -230,7 +230,9 @@ test('should work with default expect matchers and esModuleInterop=false', async'rootDir': '.','esModuleInterop': false,'allowSyntheticDefaultImports': true,- 'lib': ['esnext', 'dom', 'DOM.Iterable']+ 'lib': ['esnext', 'dom', 'DOM.Iterable'],+ 'types': ['node'],+ 'ignoreDeprecations': '6.0',},'exclude': ['node_modules'diff --git a/tests/playwright-test/playwright-test-fixtures.ts b/tests/playwright-test/playwright-test-fixtures.tsindex 9668eaf37b..dba9934c2b 100644--- a/tests/playwright-test/playwright-test-fixtures.ts+++ b/tests/playwright-test/playwright-test-fixtures.ts@@ -359,8 +359,10 @@ const TSCONFIG = {'allowSyntheticDefaultImports': true,'rootDir': '.','lib': ['esnext', 'dom', 'DOM.Iterable'],+ 'types': ['node'],'noEmit': true,'skipLibCheck': true,+ 'ignoreDeprecations': '6.0',},'exclude': ['node_modules'diff --git a/tests/playwright-test/resolver.spec.ts b/tests/playwright-test/resolver.spec.tsindex d4dec96495..0c4de8a501 100644--- a/tests/playwright-test/resolver.spec.ts+++ b/tests/playwright-test/resolver.spec.ts@@ -817,7 +817,8 @@ test.describe('directory imports', () => {"moduleResolution": "bundler","module": "preserve","noEmit": true,- "noImplicitAny": true+ "noImplicitAny": true,+ "types": ["node"]}}`,@@ -861,7 +862,8 @@ test.describe('directory imports', () => {"moduleResolution": "bundler","module": "preserve","noEmit": true,- "noImplicitAny": true+ "noImplicitAny": true,+ "types": ["node"]}}`,@@ -899,7 +901,9 @@ test.describe('directory imports', () => {"moduleResolution": "bundler","module": "preserve","noEmit": true,- "noImplicitAny": true+ "noImplicitAny": true,+ "types": ["node"],+ "ignoreDeprecations": "6.0"}}`,@@ -946,7 +950,9 @@ test.describe('directory imports', () => {"moduleResolution": "bundler","module": "preserve","noEmit": true,- "noImplicitAny": true+ "noImplicitAny": true,+ "types": ["node"],+ "ignoreDeprecations": "6.0"},}`,@@ -996,7 +1002,8 @@ test.describe('directory imports', () => {"moduleResolution": "bundler","module": "preserve","noEmit": true,- "noImplicitAny": true+ "noImplicitAny": true,+ "types": ["node"]},}`,@@ -1038,7 +1045,8 @@ test.describe('directory imports', () => {"moduleResolution": "bundler","module": "preserve","noEmit": true,- "noImplicitAny": true+ "noImplicitAny": true,+ "types": ["node"]},}`,@@ -1082,7 +1090,9 @@ test.describe('directory imports', () => {"moduleResolution": "bundler","module": "preserve","noEmit": true,- "noImplicitAny": true+ "noImplicitAny": true,+ "types": ["node"],+ "ignoreDeprecations": "6.0"}}`,@@ -1134,7 +1144,9 @@ test.describe('directory imports', () => {"moduleResolution": "bundler","module": "preserve","noEmit": true,- "noImplicitAny": true+ "noImplicitAny": true,+ "types": ["node"],+ "ignoreDeprecations": "6.0"}}`,diff --git a/tests/third_party/proxy/index.ts b/tests/third_party/proxy/index.tsindex b3b4c450f2..8c5450a95f 100644--- a/tests/third_party/proxy/index.ts+++ b/tests/third_party/proxy/index.ts@@ -467,7 +467,7 @@ function requestAuthorization(res.end('Proxy authorization required');}-function onupgrade(req: http.IncomingMessage, socket: net.Socket, head: Buffer) {+function onupgrade(this: ProxyServer, req: http.IncomingMessage, socket: net.Socket, head: Buffer) {const proxyReq = http.request(req.url, {method: req.method,headers: req.headers,diff --git a/tests/tsconfig.json b/tests/tsconfig.jsonindex 3904a25f3d..d9df9e1380 100644--- a/tests/tsconfig.json+++ b/tests/tsconfig.json@@ -30,9 +30,11 @@"noEmit": true,"noImplicitOverride": true,"strictNullChecks": false,+ "noImplicitAny": false,"useUnknownInCatchVariables": false,"useDefineForClassFields": false,"skipLibCheck": true,+ "ignoreDeprecations": "6.0",},"include": ["**/*.spec.js", "**/*.ts"],"exclude": ["components/", "installation/fixture-scripts/", "packages/playwright-core/lib/"]diff --git a/tsconfig.json b/tsconfig.jsonindex f321b66211..c26c7fc9c6 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -42,5 +42,6 @@"include": ["packages"],"exclude": ["packages/*/lib",+ "packages/extension",]}diff --git a/utils/generate_types/overrides-test.d.ts b/utils/generate_types/overrides-test.d.tsindex d92b3ee455..5e302cb820 100644--- a/utils/generate_types/overrides-test.d.ts+++ b/utils/generate_types/overrides-test.d.ts@@ -319,7 +319,7 @@ export type PlaywrightTestConfig<TestArgs = {}, WorkerArgs = {}> = Config<Playwr// Use the global URLPattern type if available (Node.js 22+, modern browsers),// otherwise fall back to `never` so it disappears from union types.-type URLPattern = typeof globalThis extends { URLPattern: infer T } ? T : never;+type URLPattern = typeof globalThis extends { URLPattern: new (...args: any) => infer T } ? T : never;type AsymmetricMatcher = Record<string, any>;interface AsymmetricMatchers {diff --git a/utils/generate_types/overrides.d.ts b/utils/generate_types/overrides.d.tsindex fbbc8ec31d..bc0b2eba4a 100644--- a/utils/generate_types/overrides.d.ts+++ b/utils/generate_types/overrides.d.ts@@ -21,7 +21,7 @@ import { Serializable, EvaluationArgument, PageFunction, PageFunctionOn, SmartHa// Use the global URLPattern type if available (Node.js 22+, modern browsers),// otherwise fall back to `never` so it disappears from union types.-type URLPattern = typeof globalThis extends { URLPattern: infer T } ? T : never;+type URLPattern = typeof globalThis extends { URLPattern: new (...args: any) => infer T } ? T : never;type PageWaitForSelectorOptionsNotHidden = PageWaitForSelectorOptions & {state?: 'visible'|'attached';diff --git a/utils/generate_types/test/tsconfig.json b/utils/generate_types/test/tsconfig.jsonindex 027e165a80..91891afbc5 100644--- a/utils/generate_types/test/tsconfig.json+++ b/utils/generate_types/test/tsconfig.json@@ -4,7 +4,9 @@"target": "ESNext","noEmit": true,"moduleResolution": "node",- "allowSyntheticDefaultImports": true+ "allowSyntheticDefaultImports": true,+ "types": ["node"],+ "ignoreDeprecations": "6.0"},"include": ["test.ts"