Correct JavaScript refusal descriptions for mutable bindings and missing properties
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- node.js, typescript
- Lĩnh vực
- developer-experience, testing
Hướng nghiên cứu
Read the refusal descriptions and preflight regression tests for TS2629, TS2630, and TS2739; the issue does not name their file paths. Start by running the existing preflight diagnostics for the four examples in the issue. Done when the descriptions accurately cover ordinary object shape and mutable declaration bindings, distinguish named function expression behavior, preserve diagnostic codes and admission decisions, and the regression tests exercise actual preflight diagnostics.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
While compiling the full Sentry CLI and its JavaScript dependencies, several refusals describe different JavaScript behavior from the code being rejected. This makes it difficult to tell whether a dependency is invalid or scriptc needs additional lowering support.
This follows up on #3037 and #3039. Those were closed as fixed by #3112, but that PR's merged diff contains the regex change; these three descriptions are still unchanged on current main.
For example, save either example as example.mjs:
class Value {}
Value = class Replacement {};
console.log(Value.name);
Node prints Replacement. scriptc refuses the assignment and says the class binding is read-only and Node throws a TypeError (TS2629). A class declaration has a mutable outer binding; the class's inner binding is a separate immutable binding.
function value() { return 1; }
value = () => 2;
console.log(value());
Node prints 2, including in a module. scriptc's TS2630 hint instead says Node throws a TypeError in strict mode and modules. A function declaration is mutable; a named function expression's inner binding has different assignment behavior.
There is also a misleading TS2739 description:
// @ts-check
/** @type {{ first: string, second: string, third: string }} */
export const value = { first: "one" };
scriptc describes this as a set-like argument missing has and size. This example has no Set operation; it is an ordinary value missing properties required by its target type.
The requested fix is limited to accurate refusal descriptions. It should preserve the diagnostic codes and admission decisions, distinguish mutable declaration bindings from immutable inner bindings, and describe TS2739 without assuming a Set protocol. Regression tests should exercise actual preflight diagnostics rather than just checking the table's source text.
Reproduced with scriptc 0.4.9 built from current main and Node 24.22.1. Four real preflight regression cases fail with the current descriptions: ordinary object shape, function declaration, class declaration, and named function expression. Related earlier work: #3037, #3039, #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 1 ngày trước. Đ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
-
Optional JSDoc rejects mandatory JavaScript setter parametersCó thể đã có người làm @MathurAditya724 đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
vercel-labs/scriptc#3355 ·
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ự
-
documentation good first issue roadmap
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/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 78/100
resend/react-email#3876 ·
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 82/100
siyuan-note/siyuan#21324 ·
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 74/100
dmno-dev/varlock#1279 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
himynameisdave/bsky-profanity-counter#59 ·
Maintainer thường phản hồi trong vòng 1 ngày