@inthedark/dxlint

中文文档
0.1.12发布于 2026/11/01MIT零依赖构建来源已验证

let you and your agents own your linter

原始使用文档
文档目录4 节
  1. another linter? ugh...
  2. getting started
  3. the language
  4. performance

dxlint

let you and your agents own your linter

import .ts
import rules:recommended

rule es-eqeqeq error
rule es-no-floating-promises
$ dxlint
warn: Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator. [no-floating-promises]
  --> src/save.ts:4:3
  |
4 |   writeFile(path, data);
  |   ^^^^^^^^^^^^^^^^^^^^^^

another linter? ugh...

  • it's over 200× faster than eslint+typescript-eslint. because apples to apples requires eslint without its caching enabled, and dxlint's cache is intrinsic. (even without that, it's also twice as fast and significantly less memory hungry)
  • and it has almost perfect eslint parity. 99.4% of eslint's and typescript-eslint's test cases give the same result. type-aware rules read your tsconfig.json without running typescript
  • everything is overrideable, you own it all. built-in rules are .dx files: override them, tweak them, write your own, or describe a whole new language
  • plus a high quality vscode extension too! extremely fast, with diagnostics, with a proper .dx lsp

getting started

npm install --save-dev @inthedark/dxlint

put a .dx at your project root:

import .ts
import rules:recommended

ignore "dist" "src/generated/**"
command
dxlint [paths]lint the project (respects .gitignore)
dxlint --fixapply fixes
dxlint ruleslist every rule with its options
dxlint describe <name>explain a rule, option or anything else in the config

exit code 1 means errors were found, 2 means the config is broken. 

don't forget to add .dxcache to .gitignore!!!

for more on the basics: docs/basic.md and the rule list.

the language

a rule is a few lines of .dx: where to look, when it is wrong, and optionally the fix

import .ts

in ts_call.callee rule no-alert-calls error "use the notification service instead of {text}" {
  when text == "alert"
}

docs/advanced.md covers the whole language, from rules over the built-in syntax trees to defining your own languages. docs/ts.md covers what the TypeScript library understands: scopes, modules, types and narrowing.

performance

one core (--jobs 1, both pinned to the same core, wall time, measured in one session), on a project with 2,094 .ts files, its complex custom eslint config ported, type-aware rules included:

ESLintdxlint
first run164 s72 s
cached run, nothing changed4.4 s0.8 s
peak memory (working set)2.0 GB0.7 GB

and remember: this isn't a fair comparison because eslint --cache doesn't work with typescript-eslint! 

also note that by default dxlint uses every core, and is significantly better at that than eslint+typescript-eslint due to no reliance on typescript itself

版本与发布记录

@inthedark/dxlint 共发布 14 个版本,首次发布于 2026/10/25;过去 12 个月发布了 14 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.12latest2026/11/012 天前
0.1.112026/11/012 天前
0.1.102026/11/012 天前
0.1.92026/10/304 天前
0.1.82026/10/304 天前
0.1.72026/10/295 天前

关于 @inthedark/dxlint 的常见问题

@inthedark/dxlint 是什么?

让你和你的经纪人拥有你的衣料

如何安装 @inthedark/dxlint?

在项目目录运行 npm install @inthedark/dxlint,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 dxlint,可以用 npx dxlint 直接运行。

@inthedark/dxlint 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/inthedark__dxlint 是否存在。

@inthedark/dxlint 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@inthedark/dxlint 可以商用吗?

@inthedark/dxlint 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@inthedark/dxlint 还在维护吗?

最新版本 0.1.12 发布于 2026/11/01(2 天前);至今共发布 14 个版本,其中过去 12 个月发布了 14 个;首次发布于 2026/10/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。