-
-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Note
Disclosure: I used Gemini for prototyping output and translation.
The Problem
When analyzing tsgolint bottlenecks in large repositories, it is difficult to identify exactly which rule is causing performance issues purely by analyzing logs.
Proposed Solution
I propose adding an environment variable OXLINT_TSGOLINT_STATS to display detailed statistical information. By exposing the following data during analysis, we can improve efficiency for user performance reporting, bottleneck identification, and simple benchmarking.
- Typecheck/Lint execution time distribution
- Information similar to
tsgo --diagnostics - Execution time per rule
- Execution time per program
These statistics serve as a high-level complement to lower-level profiling tools like pprof and trace.
Output
$ OXLINT_TSGOLINT_STATS oxlint --type-aware
Version:
tsgolint v0.11.3
tsgo 7.0.0-dev.20260107.1
Typecheck:
Program Wall Time Files
tsconfig.json 11.042s 100
inferred program 1.020s 1000
packages/core/tsconfig.json 0.080s 200
packages/cli/tsconfig.json 0.020s 300
────────────────────────────────────────────────
Total 12.142s 1600
Lint:
Rule CPU Time
no_misused_promises 11.200s
await_thenable 0.003s
no_floating_promises 0.001s
no_base_to_string 0.001s
no_deprecated 0.001s
... 39 more rules (0.000s)
────────────────────────────────────────
Traversal+overhead 0.705s
Total 11.210s
Summary:
Category Wall time
typecheck 12.142s
lint 11.204s
- Typecheck: Displays execution time and file counts for all items (sorted by time in descending order).
- Lint: Displays the top 5 rules by cpu time (descending order).
Question
@camc314 @Boshen
It appears that oxlint does not currently have a similar feature. Should this information be handled by oxlint side instead?
Personally, since oxlint processes files individually and does not perform cross-file linting (unlike tsgolint where type-checking overhead is significant), I believe this specific mechanism is not necessary for oxlint.