Optional JSDoc rejects mandatory JavaScript setter parameters
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, node.js, typescript
Hướng nghiên cứu
Start at the setter-parameter preflight gate and the parser representation of optional JSDoc tokens; the issue does not name source files or test paths. Add regression coverage for class and object setters, checked JavaScript, syntax negatives, many setters, and same-filename JSX snapshots, then compare assignments, stored values, descriptors, and side effects with Node. Done means comment-only optional annotations pass while executable setter restrictions and caller checks remain intact.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The generated Symbolic bindings used by the full Sentry CLI document several JavaScript setter parameters as optional in JSDoc. The executable parameters themselves are mandatory. Node accepts these setters, but scriptc rejects them before lowering.
This follows up on #3036 and #3044. They were closed as fixed by #3112, but that merged diff contains the regex change; current main still rejects this example:
class Store {
constructor() { this.stored = null; }
/** @param {string | null} [next] */
set value(next) { this.stored = next; }
}
const store = new Store();
store.value = "kept";
console.log(store.stored);
Node prints kept. scriptc reports SC0001: A 'set' accessor cannot have an optional parameter. The diagnostic points into the JSDoc comment, not an executable ? parameter. The same problem occurs for object-literal setters and with // @ts-check.
The parser represents the optional JSDoc annotation with a synthetic optional token, and the preflight gate treats it as executable setter syntax. The full CLI currently has five instances of this diagnostic in Symbolic's generated bindings.
The requested fix should admit this comment-only JavaScript case while preserving errors for real optional, default, rest, or multiple setter parameters and keeping caller type checks and reflective argument-count restrictions intact.
A dependency can contain many documented setters, so eligibility should not rescan the whole file for every diagnostic. A per-preflight index keyed by SourceFile identity can collect attached comment spans once and find a containing span with binary search. SourceFile identity matters because original and rewritten JSX snapshots can share a filename but have different offsets.
Regression coverage should include class and object setters, checked JavaScript, the real syntax negatives, many setters, and JSX snapshots sharing a filename. Native differential coverage should check assignments, stored values, descriptor behavior, and observable side effects against Node.
Reproduced with scriptc 0.4.9 built from current main and Node 24.22.1. The current-main positive setter tests fail with TS1051 before any production change. Related earlier work: #3036, #3044, #3112.
- Ngôn ngữ chính
- TypeScript
- Star
- 6.5k
- Fork
- 212
- Merge trung bình
- 13 giờ 2 phút
- Pull request đã merge (30 ngày)
- 798
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của vercel-labs/scriptc
-
Discarded negation of a void call rejects valid JavaScriptCó thể đã có người làm @MathurAditya724 đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 1/100
vercel-labs/scriptc#3358 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Correct JavaScript refusal descriptions for mutable bindings and missing propertiesCó thể đã có người làm @MathurAditya724 đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
vercel-labs/scriptc#3354 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
vercel-labs/scriptc#3330 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
vercel-labs/scriptc#3210 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Abstract methods block coverage and direct calls when no subclass existsCó thể đã có người làm @alantriesagain đã nhận 2 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
vercel-labs/scriptc#3077 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của vercel-labs/scriptc
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/vscode-containers#655 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dsh-tauri-desk/deepseek-harness-desktop#1477 · 1 bình luận ·
-
[docs] RELEASE.md: wrong branch name, no check that the prepare PR merged with the right subject, manual publish stepCó thể đã có người làm @albertteoh đã nhận hôm nay. Đang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
jaegertracing/jaeger-ui#4739 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Shop On TV SDĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày