Skip to content

Commit 1132667

Browse files
authored
chore: bump TypeScript to v5.5 (#31532)
1 parent 2b94fa2 commit 1132667

File tree

8 files changed

+100
-205
lines changed

8 files changed

+100
-205
lines changed

package-lock.json

Lines changed: 87 additions & 191 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@
7070
"@types/resize-observer-browser": "^0.1.7",
7171
"@types/ws": "^8.5.3",
7272
"@types/xml2js": "^0.4.9",
73-
"@typescript-eslint/eslint-plugin": "^6.13.2",
74-
"@typescript-eslint/parser": "^6.13.2",
75-
"@typescript-eslint/utils": "^6.13.2",
73+
"@typescript-eslint/eslint-plugin": "^7.15.0",
74+
"@typescript-eslint/parser": "^7.15.0",
75+
"@typescript-eslint/utils": "^7.15.0",
7676
"@vitejs/plugin-basic-ssl": "^1.1.0",
7777
"@vitejs/plugin-react": "^4.2.1",
7878
"@zip.js/zip.js": "^2.7.29",
@@ -98,7 +98,7 @@
9898
"react-dom": "^18.1.0",
9999
"socksv5": "0.0.6",
100100
"ssim.js": "^3.5.0",
101-
"typescript": "^5.3.2",
101+
"typescript": "^5.5.3",
102102
"vite": "^5.0.13",
103103
"ws": "^8.17.1",
104104
"xml2js": "^0.5.0",

packages/playwright-core/src/cli/driver.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export function runDriver() {
4242
const isJavaScriptLanguageBinding = !process.env.PW_LANG_NAME || process.env.PW_LANG_NAME === 'javascript';
4343
const replacer = !isJavaScriptLanguageBinding && (String.prototype as any).toWellFormed ? (key: string, value: any): any => {
4444
if (typeof value === 'string')
45-
// @ts-expect-error
4645
return value.toWellFormed();
4746
return value;
4847
} : undefined;

packages/playwright-core/src/client/elementHandle.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,16 @@ export async function convertInputFiles(files: string | FilePayload | string[] |
282282
if (!items.every(item => typeof item === 'string'))
283283
throw new Error('File paths cannot be mixed with buffers');
284284

285-
const [localPaths, localDirectory] = await resolvePathsAndDirectoryForInputFiles(items as string[]);
285+
const [localPaths, localDirectory] = await resolvePathsAndDirectoryForInputFiles(items);
286286

287287
if (context._connection.isRemote()) {
288288
const files = localDirectory ? (await fs.promises.readdir(localDirectory, { withFileTypes: true, recursive: true })).filter(f => f.isFile()).map(f => path.join(f.path, f.name)) : localPaths!;
289289
const { writableStreams, rootDir } = await context._wrapApiCall(async () => context._channel.createTempFiles({
290-
rootDirName: localDirectory ? path.basename(localDirectory as string) : undefined,
290+
rootDirName: localDirectory ? path.basename(localDirectory) : undefined,
291291
items: await Promise.all(files.map(async file => {
292292
const lastModifiedMs = (await fs.promises.stat(file)).mtimeMs;
293293
return {
294-
name: localDirectory ? path.relative(localDirectory as string, file) : path.basename(file),
294+
name: localDirectory ? path.relative(localDirectory, file) : path.basename(file),
295295
lastModifiedMs
296296
};
297297
})),

packages/playwright-core/src/server/webkit/wkExecutionContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class WKExecutionContext implements js.ExecutionContextDelegate {
6363
rawCallFunctionNoReply(func: Function, ...args: any[]) {
6464
this._session.send('Runtime.callFunctionOn', {
6565
functionDeclaration: func.toString(),
66-
objectId: args.find(a => a instanceof js.JSHandle)!._objectId,
66+
objectId: args.find(a => a instanceof js.JSHandle)!._objectId!,
6767
arguments: args.map(a => a instanceof js.JSHandle ? { objectId: a._objectId } : { value: a }),
6868
returnByValue: true,
6969
emulateUserGesture: true

packages/playwright/types/test.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4815,9 +4815,9 @@ export type Fixtures<T extends KeyValue = {}, W extends KeyValue = {}, PT extend
48154815
} & {
48164816
[K in keyof PT]?: TestFixtureValue<PT[K], T & W & PT & PW> | [TestFixtureValue<PT[K], T & W & PT & PW>, { scope: 'test', timeout?: number | undefined, title?: string, box?: boolean }];
48174817
} & {
4818-
[K in keyof W]?: [WorkerFixtureValue<W[K], W & PW>, { scope: 'worker', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
4818+
[K in Exclude<keyof W, keyof PW>]?: [WorkerFixtureValue<W[K], W & PW>, { scope: 'worker', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
48194819
} & {
4820-
[K in keyof T]?: TestFixtureValue<T[K], T & W & PT & PW> | [TestFixtureValue<T[K], T & W & PT & PW>, { scope?: 'test', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
4820+
[K in Exclude<keyof T, keyof PT>]?: TestFixtureValue<T[K], T & W & PT & PW> | [TestFixtureValue<T[K], T & W & PT & PW>, { scope?: 'test', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
48214821
};
48224822

48234823
type BrowserName = 'chromium' | 'firefox' | 'webkit';

tests/playwright-test/types.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ test('should check types of fixtures', async ({ runTSC }) => {
7272
baz: true,
7373
});
7474
const fail9 = test.extend<{ foo: string }>({
75-
// @ts-expect-error
7675
foo: [ async ({}, use) => {
7776
await use('foo');
77+
// @ts-expect-error
7878
}, { scope: 'test', auto: true } ],
7979
});
8080
const fail10 = test.extend<{}, {}>({

utils/generate_types/overrides-test.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ export type Fixtures<T extends KeyValue = {}, W extends KeyValue = {}, PT extend
144144
} & {
145145
[K in keyof PT]?: TestFixtureValue<PT[K], T & W & PT & PW> | [TestFixtureValue<PT[K], T & W & PT & PW>, { scope: 'test', timeout?: number | undefined, title?: string, box?: boolean }];
146146
} & {
147-
[K in keyof W]?: [WorkerFixtureValue<W[K], W & PW>, { scope: 'worker', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
147+
[K in Exclude<keyof W, keyof PW>]?: [WorkerFixtureValue<W[K], W & PW>, { scope: 'worker', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
148148
} & {
149-
[K in keyof T]?: TestFixtureValue<T[K], T & W & PT & PW> | [TestFixtureValue<T[K], T & W & PT & PW>, { scope?: 'test', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
149+
[K in Exclude<keyof T, keyof PT>]?: TestFixtureValue<T[K], T & W & PT & PW> | [TestFixtureValue<T[K], T & W & PT & PW>, { scope?: 'test', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
150150
};
151151

152152
type BrowserName = 'chromium' | 'firefox' | 'webkit';

0 commit comments

Comments
 (0)