JSDoc: a nested @property with a type that does not parse drops every nested @property after it
维护者通常 1 天内回复
@NullVoxPopuli 已经在做这个了。
开始于 2026年10月29日。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, typescript
- 领域
- compilers, testing-qa
调研方向
Start by tracing how the JSDoc parser handles nested @property tags in the supplied index.js example, then compare its recovery with the flat-property case described in the issue. Use the supplied tsconfig.json and check.ts repro to confirm that only Args.onSave is omitted while Args.onCancel remains in keyof Sig['Args'].
由索引模型根据 Issue 内容生成。
描述
[!NOTE]
Investigated with Claude (via Claude Code); corrections welcome.
🔎 Search Terms
jsdoc, typedef, nested property, function(, TS1005
🕗 Version & Regression Information
- Works:
6.0.3 - Broken:
7.0.2,7.1.0-beta,7.1.0-dev.20261029.1
CHANGES.md says Closure-style function(...) types are no longer supported, so the TS1005 is expected. This issue is about what happens to the other @property tags in the same typedef.
💻 Code
tsconfig.json
{
"compilerOptions": { "allowJs": true, "checkJs": true, "noEmit": true, "strict": true },
"include": ["index.js", "check.ts"]
}
index.js
/**
* @typedef Sig
* @property {object} Args
* @property {string} Args.name
* @property {function(string)=} Args.onSave
* @property {((v: string) => void)=} Args.onCancel
*/
export {};
check.ts
import type { Sig } from './index.js';
export const a: Array<keyof Sig['Args']> = ['name'];
export const b: Array<keyof Sig['Args']> = ['onSave'];
export const c: Array<keyof Sig['Args']> = ['onCancel'];
🙁 Actual behavior
check.ts(4,45): error TS2322: Type '"onSave"' is not assignable to type '"name"'.
check.ts(5,45): error TS2322: Type '"onCancel"' is not assignable to type '"name"'.
index.js(5,23): error TS1005: '}' expected.
onCancel is also missing, but its type has valid syntax. Every nested property after the one that does not parse is gone.
With flat properties (@property {function(string)=} onSave), only onSave is missing and onCancel is kept. So the problem is in recovery for nested Args.* properties.
🙂 Expected behavior
Only Args.onSave is affected. Args.onCancel is kept, as it is with flat properties.
Additional information about the issue
In real code the only error at the use site is that the property does not exist. For example, a component invocation reports 'onCancel' does not exist in type ..., in a different file from the TS1005. With many typedefs in a codebase, it is hard to connect the two.
- 主要语言
- Go
- 星标
- 112k
- 派生
- 15.4k
- 平均合并
- 2 天 21 小时
- 30 天内合并 PR
- 126
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/TypeScript 的其他 Issue
-
Won't Fix
难度 2/5 1-3 小时 新手友好度 62/100
microsoft/TypeScript#65107 · 1 条评论 ·
维护者通常 1 天内回复
-
Native API: formatDiagnosticsWithColorAndContext drops related information without a file location可能已有人在做 @timurzvural 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
microsoft/TypeScript#65087 ·
维护者通常 1 天内回复
-
TS7 LSP: documentHighlight returns nothing when the file path contains '@'可能重新可做 关联的 PR 已关闭且未合并。 未关闭Bug
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/TypeScript#64758 ·
维护者通常 1 天内回复
-
Language server (tsc --lsp) exits with code 1 after `shutdown` and `exit`可能已有人在做 @rajnish-verma-22172 于 13 天前认领。 未关闭Bug
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/TypeScript#64742 · 1 条评论 ·
维护者通常 1 天内回复
-
Class names `eval` and `arguments` are not reported as invalid strict mode bindings可能已有人在做 @dmety 于 26 天前认领。 未关闭Bug
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/TypeScript#64661 ·
维护者通常 1 天内回复
查看 microsoft/TypeScript 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
hyperledger/fabric-x-orderer#1409 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
needs-area
难度 2/5 1-3 小时 新手友好度 68/100
Azure/typespec-azure#5936 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 72/100
github/gh-actions-lock#261 ·
维护者通常 1 天内回复