Skip to content

Conversation

@vidorteg
Copy link
Contributor

@vidorteg vidorteg commented Oct 8, 2025

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.
  • replaced toBeCalled with toHaveBeenCalledWith as former has been deprecated
  • replaced toBeCalledWith with toHaveBeenCalledWith as former has been deprecated
  • Updating module and target on tsconfig to ES2020 ES2022
  • Removed .eslintignore as usage in a single file is disallowed by new version of eslint, instead added ignorePattern in new config file
  • Various fixes to get clean eslint run.

Copilot AI review requested due to automatic review settings October 8, 2025 17:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.js format 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,
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'es20222' to 'es2022'.

Suggested change
...globals.es20222,
...globals.es2022,

Copilot uses AI. Check for mistakes.
await expect(responsePromise).rejects.toBe(expectedErrorReason);
expect(promiseRejectCount).toEqual(1);
expect(mockOnReturn).toBeCalledWith("error", expect.any(Function));
expect(mockOnReturn).toHaveBeenCalledWith ("error", expect.any(Function));
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra space before opening parenthesis in function call.

Copilot uses AI. Check for mistakes.
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);
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra space before opening parenthesis in function call.

Copilot uses AI. Check for mistakes.
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] });
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra space before opening parenthesis in function call.

Copilot uses AI. Check for mistakes.
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});
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra space before opening parenthesis in function call.

Copilot uses AI. Check for mistakes.
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'));
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra space before opening parenthesis in function call.

Copilot uses AI. Check for mistakes.
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.'));
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra space before opening parenthesis in function call.

Copilot uses AI. Check for mistakes.
const { callback, thisObj } = getFirstCallback(mockPanel.webview.onDidReceiveMessage);
callback.call(thisObj, expectedMessage);
expect(mockPanelSocket.onMessageFromWebview).toBeCalledWith(expectedMessage);
expect(mockPanelSocket.onMessageFromWebview).toHaveBeenCalledWith (expectedMessage);
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra space before opening parenthesis in function call.

Copilot uses AI. Check for mistakes.

await hookedEvents.get("getUrl")!(JSON.stringify(expectedRequest));
expect(mockUtils.fetchUri).toBeCalledWith(expectedRequest.url);
expect(mockUtils.fetchUri).toHaveBeenCalledWith (expectedRequest.url);
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra space before opening parenthesis in function call.

Copilot uses AI. Check for mistakes.

await hookedEvents.get("getUrl")!(JSON.stringify(expectedRequest));
expect(mockUtils.fetchUri).toBeCalledWith(expectedRequest.url);
expect(mockUtils.fetchUri).toHaveBeenCalledWith (expectedRequest.url);
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra space before opening parenthesis in function call.

Copilot uses AI. Check for mistakes.
@vidorteg vidorteg closed this Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants