Skip to content

typescript: upgrade eslint to v9 - #1802

Merged
jtbandes merged 3 commits into
mainfrom
jacob/upgrade-eslint
Aug 11, 2026
Merged

typescript: upgrade eslint to v9#1802
jtbandes merged 3 commits into
mainfrom
jacob/upgrade-eslint

Conversation

@jtbandes

@jtbandes jtbandes commented Aug 11, 2026

Copy link
Copy Markdown
Member

Changelog

None

Docs

None

Description

Upgrades ESLint, typescript-eslint, @foxglove/eslint-plugin and remove some unneeded dependencies.

I believe our eslint plugin is not yet ready for v10, but v9 is a significant change (requires rewriting config files) that will make a later v10 upgrade easier.

Comment thread .vscode/settings.json
"files.trimTrailingWhitespace": true,

"typescript.tsdk": "node_modules/typescript/lib",
"js/ts.tsdk.path": "node_modules/typescript/lib",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is js/ts.tsdk.path a real setting? The documented key for pointing VS Code (and Cursor) at the workspace TypeScript is typescript.tsdk, which is what this was. If js/ts.tsdk.path is silently ignored, contributors lose "Use Workspace Version" and their editor falls back to the bundled TS — an easy source of phantom type errors. Was this an intentional rename, or a slip?

Comment thread website/eslint.config.mjs Outdated
claude[bot]

This comment was marked as outdated.

@clalancette clalancette left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found three minor sites where I think we should actually fix the code rather than adding the suppression. The rest of it looks good to me.

Comment on lines 297 to 299
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (error) {
console.log(`- missing ${filePath}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For what it is worth, this seems like a real bug to me. We don't know that fs.readFile threw because of a missing file; it could equally be permissions, etc. So I'd suggest actually printing the error in console.log, which would allow us to remove the no-unused-vars lint above.

Comment on lines 262 to 263
// eslint-disable-next-line @typescript-eslint/no-deprecated
await bag.readMessages(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similarly, I think here we should consider fixing this to use for await (const result of bag.messageIterator({ topics: ... })) { ... } and getting rid of the lint annotation.

Comment on lines 145 to 146
// eslint-disable-next-line @typescript-eslint/no-deprecated
return reader.readMessage(data).toJSON();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similarly, I think we should change this to use toObject() instead of toJSON(), and then we can remove the no-deprecated lint option above.

@clalancette clalancette left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fixes, looks good to me!

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Prior unresolved thread on .vscode/settings.json (js/ts.tsdk.path) still open — see above.

}
const start = reader.offset;
const opcode = reader.uint8();
const opcode: Opcode = reader.uint8();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does @mcap/core still typecheck after this? reader.uint8() returns number, and number isn't assignable to the numeric enum Opcode without a cast — so const opcode: Opcode = reader.uint8() should error TS2322. The old switch (opcode as Opcode) was carrying that cast, and dropping it moved the (now-invalid) coercion onto the annotation. If tsc is green, ignore me; otherwise keep const opcode = reader.uint8() with switch (opcode as Opcode), or write const opcode = reader.uint8() as Opcode.

@jtbandes
jtbandes merged commit 6fa700b into main Aug 11, 2026
31 checks passed
@jtbandes
jtbandes deleted the jacob/upgrade-eslint branch August 11, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants