Repository navigation
fix: drop eslint-plugin-tsdoc from the TypeScript lint preset - #130
Conversation
| if (configFile.fileNotFound) return { parser: new TSDocParser(configuration), applyError: undefined }; | ||
| let applyError; | ||
| try { | ||
| configFile.configureParser(configuration); |
There was a problem hiding this comment.
Config errors repeat once per linted file.
configureParser writes some errors into the config object itself, such as a supportForTags entry naming an undefined tag. Since the object is cached, every file adds another copy. File N reports "error loading TSDoc config file" with the same line N times, and the cached object's error list keeps growing. Upstream checks hasErrors before configuring, so it hides this on the first file. Here, the report comes after, so even the first file shows it.
There was a problem hiding this comment.
We should build the parser once, when the config is loaded, and cache it with the config. In configFor, store { configFile, ...parserFor(configFile) } in the map, and check isStale(entry.configFile). create then reads configFile, parser and applyError from that entry. This also stops rebuilding the parser setup for every file. Reusing one parser is safe because parseRange does not keep state between calls.
| } | ||
| } | ||
|
|
||
| function configFor(filename) { |
There was a problem hiding this comment.
An unreadable tsdoc.json crashes the rule instead of reporting.
If the file exists but can't be read (wrong permissions, or a folder named tsdoc.json), that read throws, and the exception escapes create. Upstream catches this and reports "error loading TSDoc config file" on line 1.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5705002. Configure here.
There was a problem hiding this comment.
Nit: No test fails if someone moves parserFor back into create. The new tests cover reloading and unreadable files, but not this.
| return { parser: new TSDocParser(configuration), applyError }; | ||
| } | ||
|
|
||
| function loadErrorEntry(configFilePath, error) { |
There was a problem hiding this comment.
A broken extends file stays "broken" until restart.
The error can come from a base file pulled in through extends. E.g: made base.json unreadable and then fixed its permissions. The rule keep reporting EACCES because the top file never changed.
There was a problem hiding this comment.
I think we shouldn't cache the failure. In the catch, return { loadError: error } without calling configFiles.set. The next file then just retries loadFile, which costs a few file reads and only while the config is broken.

Motivation and Context
eslint-plugin-tsdocdepends on@typescript-eslint/utils, which forces TypeScript 5 into the install tree and cannot load with TypeScript 7. That is the same class of problem as the@typescript-eslintrules already replaced by the localtorusplugin.Jira Link
N/A
Description
Remove
eslint-plugin-tsdocfrom@toruslabs/oxlint-config-typescriptand depend on@microsoft/tsdocinstead. Thetsdoc/syntaxrule stays. A local Oxlint JS plugin,tsdoc-plugin.mjs, wraps@microsoft/tsdocand replaces the ESLint plugin.vp packnow ships that plugin with the preset. The lockfile drops the@typescript-eslintsubtree that the old plugin pulled in.How has this been tested?
vp test packages/oxlint-config-typescript/index.test.ts(5 tests passed), including the existingtsdoc(syntax)diagnostic checkScreenshots (if appropriate)
N/A
Types of changes
Checklist
Note
Low Risk
Scope is the TypeScript lint preset and TSDoc rule implementation; behavior is preserved with added resilience around tsdoc.json loading.
Overview
Removes
eslint-plugin-tsdocfrom@toruslabs/oxlint-config-typescriptso the preset no longer pulls in@typescript-eslint/utilsand a TypeScript 5 peer tree that breaks under TypeScript 7. Thetsdoc/syntaxrule is unchanged from a consumer perspective; it now runs through a shipped local plugin,tsdoc-plugin.mjs, built on@microsoft/tsdocand@microsoft/tsdoc-config.The new plugin still loads the nearest
tsdoc.json, caches parsed config, reloads when the file changes or appears during a long lint, reports load/apply errors instead of crashing, and does not cache load failures (so fixes toextendsfiles are picked up on the next file).vp packincludes the plugin; dependencies swap the ESLint plugin for the Microsoft packages. Tests cover custom tags, bad config, in-process reload, unreadable paths, andextendsrecovery.Reviewed by Cursor Bugbot for commit 134e37f. Bugbot is set up for automated code reviews on this repo. Configure here.