Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Proposal: add oxlint, which finds 19 unhandled promises and 170 other likely mistakes on main

Đang mở
#2,643 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Lĩnh vực
testing, tooling

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

  1. oxlint with only those correctness rules. One PR adds oxlint and oxlint-tsgolint as dev dependencies, a .oxlintrc.json with just the rules above, an npm run lint script, and fixes for the 189 findings. It reads your existing tsconfig.json, so the type-aware rules see the same types as the build. It checks the whole repository in a few seconds.
  2. Type-check the tests. tsc already checks src/ 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 a typecheck script.
  3. 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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của colbymchenry/codegraph

Tất cả issue của colbymchenry/codegraph

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.