在线 TypeScript 项目中,代码质量检查总是绕不开 ESLint 配合 typescript-eslint,但速度慢、类型感知有限,给开发体验带来不少困扰。

tsgolint 是一个高性能的 TypeScript 类型感知 linter,基于 typescript-go 实现,完全集成 Oxlint,速度比 ESLint + typescript-eslint 快 20-40 倍。

它不仅全面支持 TypeScript 类型检查,还能利用多核 CPU 并行处理,性能惊人。规则覆盖丰富,行为与 typescript-eslint 保持一致,轻松无缝替换。

主要功能:

- 原生 TypeScript 类型感知,避免误报漏报;
- 20-40 倍性能提升,适合大规模项目快速 lint;
- 多核并行,充分利用硬件资源;
- 规则丰富且可配置,支持绝大多数 typescript-eslint 规则;
- 与 Oxlint 集成,轻松配置和使用。

适合追求高效、精准代码检查的 TypeScript 项目。

安装示例:

pnpm add -D oxlint-tsgolint﹫latest
pnpm dlx oxlint --type-aware


配置示例:

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "rules": {
    "typescript/no-floating-promises": "error",
    "typescript/no-misused-promises": "error"
  }
}
 
 
Back to Top