Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the project's dependencies and updates code to align with newer versions of tooling, particularly ESLint which now requires flat configuration format.
- Updates numerous dependencies to their latest versions including ESLint, TypeScript, Jest, and various development tools
- Migrates ESLint configuration from legacy
.eslintrc.jsformat to new flat configuration - Replaces deprecated Jest matchers (
toBeCalled,toBeCalledWith) with current equivalents (toHaveBeenCalled,toHaveBeenCalledWith)
Reviewed Changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 23 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updates all dependency versions to latest releases |
| .eslintrc.js | Converts ESLint config from legacy object format to new flat array format |
| .eslintignore | Removes file as ESLint flat config handles ignores internally |
| test/*.test.ts | Updates deprecated Jest matchers to current equivalents |
| src/utils.ts | Uses modern Object.hasOwn() instead of hasOwnProperty() |
| src/launchConfigManager.ts | Fixes regex pattern escaping |
| src/errorReporter.ts | Adds trailing commas for consistency |
| src/cdpTargetsProvider.ts | Fixes regex escaping and removes outdated ESLint disable comment |
| src/cdpTarget.ts | Updates icon path handling to use proper Uri objects |
| test/helpers/helpers.ts | Improves VSCode Uri mock implementation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.eslintrc.js
Outdated
| globals: { | ||
| ...globals.browser, | ||
| ...globals.node, | ||
| ...globals.es20222, |
There was a problem hiding this comment.
Corrected spelling of 'es20222' to 'es2022'.
| ...globals.es20222, | |
| ...globals.es2022, |
test/utils.test.ts
Outdated
| await expect(responsePromise).rejects.toBe(expectedErrorReason); | ||
| expect(promiseRejectCount).toEqual(1); | ||
| expect(mockOnReturn).toBeCalledWith("error", expect.any(Function)); | ||
| expect(mockOnReturn).toHaveBeenCalledWith ("error", expect.any(Function)); |
There was a problem hiding this comment.
Remove extra space before opening parenthesis in function call.
test/utils.test.ts
Outdated
| expect(defaultUrl).toBe(expected.defaultUrl); | ||
| expect(userDataDir).toBe(expected.userDataDir); | ||
| expect(vscodeMock.workspace.getConfiguration).toBeCalledWith(utils.SETTINGS_STORE_NAME); | ||
| expect(vscodeMock.workspace.getConfiguration).toHaveBeenCalledWith (utils.SETTINGS_STORE_NAME); |
There was a problem hiding this comment.
Remove extra space before opening parenthesis in function call.
test/utils.test.ts
Outdated
| for (let i = 0; i < input.length; i++) { | ||
| utils.reportUrlType(input[i], reporter); | ||
| expect(reporter.sendTelemetryEvent).toBeCalledWith('user/browserNavigation', { 'urlType': expected[i] }); | ||
| expect(reporter.sendTelemetryEvent).toHaveBeenCalledWith ('user/browserNavigation', { 'urlType': expected[i] }); |
There was a problem hiding this comment.
Remove extra space before opening parenthesis in function call.
test/utils.test.ts
Outdated
| const reporter = createFakeTelemetryReporter(); | ||
| await utils.reportFileExtensionTypes(reporter); | ||
| expect(reporter.sendTelemetryEvent).toBeCalledWith('workspace/metadata', undefined, {"css": 1, "html": 0, "js": 1, "json": 1, "jsx": 1, "mjs": 0, "other": 0, "scss": 0, "total": 4, "ts": 0}); | ||
| expect(reporter.sendTelemetryEvent).toHaveBeenCalledWith ('workspace/metadata', undefined, {"css": 1, "html": 0, "js": 1, "json": 1, "jsx": 1, "mjs": 0, "other": 0, "scss": 0, "total": 4, "ts": 0}); |
There was a problem hiding this comment.
Remove extra space before opening parenthesis in function call.
test/extension.test.ts
Outdated
| await newExtension.attachToCurrentDebugTarget(createFakeExtensionContext()); | ||
| expect(mocks.utils.getJsDebugCDPProxyWebsocketUrl).toHaveBeenCalled(); | ||
| expect(mocks.vscode.window.showErrorMessage).toBeCalledWith(expect.stringContaining('Error Message')); | ||
| expect(mocks.vscode.window.showErrorMessage).toHaveBeenCalledWith (expect.stringContaining('Error Message')); |
There was a problem hiding this comment.
Remove extra space before opening parenthesis in function call.
test/extension.test.ts
Outdated
| await newExtension.attachToCurrentDebugTarget(createFakeExtensionContext()); | ||
| expect(mocks.utils.getJsDebugCDPProxyWebsocketUrl).toHaveBeenCalled(); | ||
| expect(mocks.vscode.window.showErrorMessage).toBeCalledWith(expect.stringContaining('Unable to attach DevTools to current debug session.')); | ||
| expect(mocks.vscode.window.showErrorMessage).toHaveBeenCalledWith (expect.stringContaining('Unable to attach DevTools to current debug session.')); |
There was a problem hiding this comment.
Remove extra space before opening parenthesis in function call.
test/devtoolsPanel.test.ts
Outdated
| const { callback, thisObj } = getFirstCallback(mockPanel.webview.onDidReceiveMessage); | ||
| callback.call(thisObj, expectedMessage); | ||
| expect(mockPanelSocket.onMessageFromWebview).toBeCalledWith(expectedMessage); | ||
| expect(mockPanelSocket.onMessageFromWebview).toHaveBeenCalledWith (expectedMessage); |
There was a problem hiding this comment.
Remove extra space before opening parenthesis in function call.
test/devtoolsPanel.test.ts
Outdated
|
|
||
| await hookedEvents.get("getUrl")!(JSON.stringify(expectedRequest)); | ||
| expect(mockUtils.fetchUri).toBeCalledWith(expectedRequest.url); | ||
| expect(mockUtils.fetchUri).toHaveBeenCalledWith (expectedRequest.url); |
There was a problem hiding this comment.
Remove extra space before opening parenthesis in function call.
test/devtoolsPanel.test.ts
Outdated
|
|
||
| await hookedEvents.get("getUrl")!(JSON.stringify(expectedRequest)); | ||
| expect(mockUtils.fetchUri).toBeCalledWith(expectedRequest.url); | ||
| expect(mockUtils.fetchUri).toHaveBeenCalledWith (expectedRequest.url); |
There was a problem hiding this comment.
Remove extra space before opening parenthesis in function call.
This PR Updates most of the dependencies, as a result some code had also been updated, here is a list of the highlights:
.eslintrc.js: The new eslint version requires the use of a flat file for configuration, so I moved the previous format to the new one.toBeCalledwithtoHaveBeenCalledWithas former has been deprecatedtoBeCalledWithwithtoHaveBeenCalledWithas former has been deprecatedmoduleandtargeton tsconfig toES2020ES2022.eslintignoreas usage in a single file is disallowed by new version of eslint, instead added ignorePattern in new config file