Proposal: add oxlint, which finds 19 unhandled promises and 170 other likely mistakes on main
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, typescript
Hướng nghiên cứu
Read the repository's tsconfig.json and package scripts to see how TypeScript checks and npm tasks are configured. The proposal describes adding oxlint dependencies, .oxlintrc.json, a lint script, and fixing 189 findings across 88 files; it also raises separate test type-checking and formatting options. Done means the maintainers choose a scope and its lint or type-check commands work with the proposed findings addressed.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A first run of oxlint's type-aware rules on main (10e316d9) reports 189 findings in 88 files that point at bugs or dead code: 19 promises that are neither awaited nor handled, 43 awaits on values that are not promises, 10 switch statements that miss members of a union, 38 assignments whose value is never read, 68 unused variables, 5 rethrown errors that drop the original error, and 6 duplicate imports. 99 are in src/, 76 in __tests__/ and 14 in scripts/. I spot-checked a few: the unhandled promises are async calls such as this.flush() inside a timer, where a rejection would surface as an unhandled rejection; some of the switch findings will be intentional.
Would you take pull requests that add linting, and possibly formatting? I'm asking before opening any, since it changes how everyone contributes.
What I'd propose, most useful first
- oxlint with only those correctness rules. One PR adds
oxlintandoxlint-tsgolintas dev dependencies, a.oxlintrc.jsonwith just the rules above, annpm run lintscript, and fixes for the 189 findings. It reads your existingtsconfig.json, so the type-aware rules see the same types as the build. It checks the whole repository in a few seconds. - Type-check the tests.
tscalready checkssrc/in strict mode with no errors, but__tests__/isn't type-checked. Running the same settings over it gives 689 errors in 149 test files, including 102 calls with the wrong number of arguments and 50 names that don't exist, which may be tests that drifted from the code. This would be a separate PR with atypecheckscript. - Formatting with oxfmt, only if you want it. With no formatter today, adopting one rewrites most files once: keeping single quotes and 120-column lines, 818 of 930 source files change (about 42,000 lines added and 24,000 removed). That conflicts with every open pull request, so it's only worth doing at a moment you pick, or not at all.
Style-only rules would stay off unless you want them, for example curly (11,128 findings) and the node: import prefix (1,840); both fix themselves with --fix. There's no CI on pull requests today; a small workflow running npm run lint could follow if you'd like one.
I'm happy to do the work and keep each PR to the scope you choose. If you'd rather not add tooling, I can send only the fixes for the bugs it found.
How this was measured
main at 10e316d9; oxlint 1.88.0 with oxlint-tsgolint 7.0.2004; oxfmt 0.73.0; TypeScript 5.9.3 from the lockfile. __tests__/fixtures/ was excluded from every count. The type check used the repository's tsconfig.json with include widened to __tests__/**/* and noEmit.
| Rule | Findings | In src/ |
|---|---|---|
typescript/no-floating-promises |
19 | 5 |
typescript/await-thenable |
43 | 3 |
typescript/switch-exhaustiveness-check |
10 | 9 |
eslint/no-useless-assignment |
38 | 36 |
eslint/no-unused-vars |
68 | 41 |
eslint/preserve-caught-error |
5 | 4 |
import/no-duplicates (plus one repeated type import) |
6 | 1 |
- Ngôn ngữ chính
- C
- Star
- 73.2k
- Fork
- 4.7k
- Merge trung bình
- 3 giờ 13 phút
- Pull request đã merge (30 ngày)
- 579
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 colbymchenry/codegraph
-
mcp: a projectPath naming a file inside a project returns isError ("Path is not a directory")Có thể đã có người làm @maxmilian đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
colbymchenry/codegraph#2982 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
mcp: a non-object tools/call arguments crashes the handler and is reported as an internal error to retryCó thể đã có người làm @kjgggggg đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
colbymchenry/codegraph#2981 ·
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
colbymchenry/codegraph#2974 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
search: FTS special characters are deleted, not separated, so leaf(entry) matches nothingCó thể đã có người làm @kjgggggg đã nhận 1 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
colbymchenry/codegraph#2971 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Security Vulnerabiliy] Vulnerable bundled `node.exe` detected (Node2Shell - CVE-2026-111497)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
colbymchenry/codegraph#2959 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của colbymchenry/codegraph
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
CanadaHonk/porffor#426 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 77/100
raysan5/raylib.com#132 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
libsdl-org/SDL#16607 ·
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 76/100
PowerShell/Win32-OpenSSH#2482 · 1 reaction ·
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SoftEtherVPN/SoftEtherVPN#2322 ·
Maintainer thường phản hồi trong vòng 1 ngày