Skip to content

Commit b2ce569

Browse files
authored
Merge pull request #21963 from ChayimFriedman2/ts-improve
internal: Improve TypeScript code
2 parents 1ec356c + a344bc7 commit b2ce569

10 files changed

Lines changed: 400 additions & 409 deletions

File tree

editors/code/package-lock.json

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

editors/code/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
"vscode-languageclient": "^9.0.1"
5858
},
5959
"devDependencies": {
60-
"@eslint/js": "^9.21.0",
61-
"@stylistic/eslint-plugin": "^4.1.0",
60+
"@eslint/js": "^10.0.1",
61+
"@stylistic/eslint-plugin": "^5.10.0",
6262
"@stylistic/eslint-plugin-js": "^4.1.0",
6363
"@tsconfig/strictest": "^2.0.5",
6464
"@types/lodash": "^4.17.20",
@@ -69,14 +69,14 @@
6969
"@vscode/test-electron": "^2.4.1",
7070
"@vscode/vsce": "^3.7.1",
7171
"esbuild": "^0.25.0",
72-
"eslint": "^9.21.0",
73-
"eslint-config-prettier": "^10.0.2",
72+
"eslint": "^10.2.0",
73+
"eslint-config-prettier": "^10.1.8",
7474
"eslint-define-config": "^2.1.0",
7575
"ovsx": "0.10.10",
76-
"prettier": "^3.5.2",
76+
"prettier": "^3.8.1",
7777
"tslib": "^2.8.1",
78-
"typescript": "^5.7.3",
79-
"typescript-eslint": "^8.25.0"
78+
"typescript": "^6.0.2",
79+
"typescript-eslint": "^8.58.0"
8080
},
8181
"activationEvents": [
8282
"workspaceContains:Cargo.toml",

editors/code/src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as anser from "anser";
1+
import anser from "anser";
22
import * as lc from "vscode-languageclient/node";
33
import * as vscode from "vscode";
44
import * as ra from "../src/lsp_ext";

editors/code/src/commands.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,9 +1194,8 @@ export function runSingle(ctx: CtxInit): Cmd {
11941194
}
11951195

11961196
export function copyRunCommandLine(ctx: CtxInit) {
1197-
let prevRunnable: RunnableQuickPick | undefined;
11981197
return async () => {
1199-
const item = await selectRunnable(ctx, prevRunnable);
1198+
const item = await selectRunnable(ctx, undefined);
12001199
if (!item || !isCargoRunnableArgs(item.runnable.args)) return;
12011200
const args = createCargoArgs(item.runnable.args);
12021201
const commandLine = ["cargo", ...args].join(" ");

editors/code/src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ export function substituteVariablesInEnv(env: Env): Env {
485485
Object.entries(env).map(([key, value]) => {
486486
const deps = new Set<string>();
487487
if (value) {
488-
let match = undefined;
488+
let match;
489489
while ((match = depRe.exec(value))) {
490490
const depName = unwrapUndefinable(match.groups?.["depName"]);
491491
deps.add(depName);

editors/code/src/debug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export async function makeDebugConfig(ctx: Ctx, runnable: ra.Runnable): Promise<
4848
}
4949

5050
export async function startDebugSession(ctx: Ctx, runnable: ra.Runnable): Promise<boolean> {
51-
let debugConfig: vscode.DebugConfiguration | undefined = undefined;
51+
let debugConfig: vscode.DebugConfiguration | undefined;
5252
let message = "";
5353

5454
const wsLaunchSection = vscode.workspace.getConfiguration("launch");

editors/code/src/dependencies_provider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import * as ra from "./lsp_ext";
66
import type { FetchDependencyListResult } from "./lsp_ext";
77
import { unwrapUndefinable } from "./util";
88

9-
export class RustDependenciesProvider
10-
implements vscode.TreeDataProvider<Dependency | DependencyFile>
11-
{
9+
export class RustDependenciesProvider implements vscode.TreeDataProvider<
10+
Dependency | DependencyFile
11+
> {
1212
dependenciesMap: { [id: string]: Dependency | DependencyFile };
1313
ctx: CtxInit;
1414

editors/code/src/diagnostics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as anser from "anser";
1+
import anser from "anser";
22
import * as vscode from "vscode";
33
import {
44
type ProviderResult,

editors/code/src/toolchain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class Cargo {
100100
);
101101
} catch (err) {
102102
log.error(`Cargo invocation has failed: ${err}`);
103-
throw new Error(`Cargo invocation has failed: ${err}`);
103+
throw new Error(`Cargo invocation has failed: ${err}`, { cause: err });
104104
}
105105

106106
return spec.filter?.(artifacts) ?? artifacts;

editors/code/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": "@tsconfig/strictest/tsconfig.json",
33
"compilerOptions": {
4-
"esModuleInterop": false,
54
"module": "NodeNext",
65
"moduleResolution": "nodenext",
76
"target": "ES2024",

0 commit comments

Comments
 (0)