From ed522bb5d623cb41cba47c3f28b92072c448f8da Mon Sep 17 00:00:00 2001 From: Rob Simmons Date: Thu, 6 Aug 2026 20:49:19 -0400 Subject: [PATCH 1/2] chore: linter fixes independent of linter addition --- package.json | 5 +++- .../src/vscode.proposed.extensionsAny.d.ts | 2 +- vscode-workbench/test/collab.test.ts | 24 +++++++++---------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 474d7a31..2e2b0456 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,10 @@ "tsc:collab-server": "npm --workspace collab-server run tsc", "tsc:vscode-workbench": "npm --workspace vscode-workbench run tsc", "tsc:workbench-app": "tsc", - "lint": "prettier --check . && eslint" + "lint": "prettier --check . && eslint", + "lint:fix": "prettier --write . && eslint . --fix", + "prettier": "prettier --check .", + "prettier:fix": "prettier --write ." }, "dependencies": { "@hocuspocus/provider": "^4.0.0", diff --git a/vscode-workbench/src/vscode.proposed.extensionsAny.d.ts b/vscode-workbench/src/vscode.proposed.extensionsAny.d.ts index ccf5a631..caaffee5 100644 --- a/vscode-workbench/src/vscode.proposed.extensionsAny.d.ts +++ b/vscode-workbench/src/vscode.proposed.extensionsAny.d.ts @@ -6,7 +6,7 @@ declare module 'vscode' { // https://github.com/microsoft/vscode/issues/145307 @alexdima - export interface Extension<_T> { + export interface Extension { /** * `true` when the extension is associated to another extension host. * diff --git a/vscode-workbench/test/collab.test.ts b/vscode-workbench/test/collab.test.ts index 4c448008..a54a2c4d 100644 --- a/vscode-workbench/test/collab.test.ts +++ b/vscode-workbench/test/collab.test.ts @@ -8,7 +8,7 @@ import { Logger } from '../src/util' const delay = (ms: number) => new Promise(r => setTimeout(r, ms)) -const logLevel: vs.LogLevel = vs.LogLevel.Debug as unknown as vs.LogLevel // cast prevents TS from complaining +const logLevel = vs.LogLevel.Debug as vs.LogLevel // cast prevents TS from complaining const consoleLog: Logger = { logLevel, trace: (m, ...a) => { @@ -132,14 +132,14 @@ suite('Collaborative editing', () => { vs.workspace.openTextDocument({ content: '', language: 'plaintext' }), ]) const bindings = docs.map( - (doc, i) => new YTextBinding(doc, clients[i], consoleLog, true, ensureSyncTimeoutMs, DOC_NAME), + (doc, i) => new YTextBinding(doc, clients[i]!, consoleLog, true, ensureSyncTimeoutMs, DOC_NAME), ) // Route document changes to the matching binding // (`YTextBindingManager.onDidChangeTextDocument` does this in production). const changeSub = vs.workspace.onDidChangeTextDocument(e => { const i = docs.indexOf(e.document) - if (i >= 0) bindings[i].onLocalChange(e) + if (i >= 0) bindings[i]!.onLocalChange(e) }) return { @@ -166,12 +166,12 @@ suite('Collaborative editing', () => { await waitForInitialSync(handles.bindings, 1_000) // Type on doc0 and confirm the change reaches doc1. - const ed0 = await vs.window.showTextDocument(handles.docs[0], { viewColumn: COLUMNS[0], preview: false }) + const ed0 = await vs.window.showTextDocument(handles.docs[0]!, { viewColumn: COLUMNS[0], preview: false }) ed0.selection = new vs.Selection(0, 0, 0, 0) const text = 'PROBE\n' await vs.commands.executeCommand('default:type', { text }) await waitForQuiescence(handles.bindings, 1_000) - assert.strictEqual(handles.docs[1].getText(), text) + assert.strictEqual(handles.docs[1]!.getText(), text) await handles.dispose() }) @@ -181,7 +181,7 @@ suite('Collaborative editing', () => { const rng = mulberry32(0xc0ffee) const NUM_EDITS = 100 for (let i = 0; i < NUM_EDITS; i++) { - await randomEditOn(handles.docs[i % 2], COLUMNS[i % 2], rng) + await randomEditOn(handles.docs[i % 2]!, COLUMNS[i % 2]!, rng) } } @@ -190,10 +190,10 @@ suite('Collaborative editing', () => { const [y0, y1] = handles.bindings.map(b => b.remoteYtext.toString()) // Sanity check - YJs CRDT replicas converge. - assert.strictEqual(y0, y1, diffMessage('Y.Text replicas (client0 vs client1)', y0, y1)) + assert.strictEqual(y0, y1, diffMessage('Y.Text replicas (client0 vs client1)', y0!, y1!)) // Whether docs correctly track CRDT replicas. - assert.strictEqual(d0, y0, diffMessage('doc0 vs its Y.Text', d0, y0)) - assert.strictEqual(d1, y1, diffMessage('doc1 vs its Y.Text', d1, y1)) + assert.strictEqual(d0, y0, diffMessage('doc0 vs its Y.Text', d0!, y0!)) + assert.strictEqual(d1, y1, diffMessage('doc1 vs its Y.Text', d1!, y1!)) } test('Concurrent edits settle on equal states', async function () { @@ -214,11 +214,11 @@ suite('Collaborative editing', () => { await waitForInitialSync(handles.bindings, 1_000) // Ensure both documents are visible: // only `TextEditor.edit`s are expected to converge without ensureSync. - await vs.window.showTextDocument(handles.docs[0], { viewColumn: COLUMNS[0], preview: false }) - await vs.window.showTextDocument(handles.docs[1], { viewColumn: COLUMNS[1], preview: false }) + await vs.window.showTextDocument(handles.docs[0]!, { viewColumn: COLUMNS[0], preview: false }) + await vs.window.showTextDocument(handles.docs[1]!, { viewColumn: COLUMNS[1], preview: false }) await makeConcurrentEdits(handles) await waitForQuiescence(handles.bindings, 3_000) - await assertEqualStates(handles) + assertEqualStates(handles) await handles.dispose() }) }) From 0dc093750d876b44aa0a4bd350a864bc8f886ac4 Mon Sep 17 00:00:00 2001 From: Rob Simmons Date: Thu, 6 Aug 2026 21:06:21 -0400 Subject: [PATCH 2/2] hmr and eslint vendor ignore --- eslint.config.mjs | 2 ++ scripts/hmr-nudge.mjs | 1 + 2 files changed, 3 insertions(+) diff --git a/eslint.config.mjs b/eslint.config.mjs index a23f4d4b..e0cc4763 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -21,6 +21,8 @@ const eslintConfig = defineConfig([ 'build/', 'next-env.d.ts', 'branch-*/', + // Ignore vendored microsoft/vscode typing files + 'vscode-workbench/src/vscode.proposed.*.d.ts', ]), { plugins: { diff --git a/scripts/hmr-nudge.mjs b/scripts/hmr-nudge.mjs index 33c06a16..970040f4 100644 --- a/scripts/hmr-nudge.mjs +++ b/scripts/hmr-nudge.mjs @@ -5,6 +5,7 @@ import { createHash } from 'node:crypto' import { readFile, utimes } from 'node:fs/promises' + import chokidar from 'chokidar' const paths = process.argv.length < 3 ? ['src'] : process.argv.slice(2)