@utoo/lint is a High performance linter for JavaScript and TypeScript written by Zig.
It uses yuku for parsing, AST
traversal, scope tracking, and symbol resolution.
It currently has some performance advantages compared with other lint tools:
This repo is a working scaffold, not a production linter yet.
Useful docs:
- Rule status lists implemented rules and their ESLint documentation links.
- Configuration describes
utoo.jsonfiles for frontend projects. - Migrating from ESLint covers the current migration path.
- Contributing covers local development, rule work, packaging, and publishing.
pnpm add -D @utoo/lintRun it with:
pnpm exec utoo-lint srcutoo-lint [options] [file-or-directory ...]If no target is provided, utoo-lint scans the current directory. It skips
.git, .zig-cache, node_modules, vendor, and zig-out.
Start a frontend project from the packaged template:
cp node_modules/@utoo/lint/configs/frontend.json utoo.json
pnpm exec utoo-lint srcRun only a focused rule set:
utoo-lint --rules=no-debugger,no-unused-vars,@typescript-eslint/no-unused-vars srcDisable a rule from the command line:
utoo-lint --no-console=off srcUse machine-readable output:
utoo-lint --format=json srcBy default, utoo-lint reads utoo.json or utoo-lint.json from the current
directory or its ancestors. Use --config=path/to/utoo.json for an explicit file or
--no-config to ignore local config.
{
"$schema": "https://raw.githubusercontent.com/fireairforce/utoo-lint/main/npm/utoo-lint/schema.json",
"files": ["src/**/*.{js,jsx,ts,tsx}"],
"ignores": ["dist", "node_modules"],
"rules": {
"no-console": "off",
"no-debugger": "error",
"@typescript-eslint/no-unused-vars": ["warn"]
}
}Rule values may be off, warn, error, 0, 1, 2, booleans, or an
ESLint-style array whose first item is the severity and later items are native
rule options.
To migrate an existing ESLint config into the native utoo format:
pnpm exec utoo-lint migrate eslint --from eslint.config.js --output utoo.jsonimport { lintFiles } from "@utoo/lint";
const report = lintFiles(["src"], {
config: "utoo.json",
rules: ["no-debugger"]
});src/root.zigowns parsing, rule execution, and public API exports.src/core.zigowns shared lint types, diagnostics, and common helpers.src/rules/root.zigregisters rules and dispatches AST visitor hooks.src/rules/*.zigcontains one lint rule per file.src/main.zigowns CLI argument parsing, file discovery, and terminal output.vendor/yukuis pinned as a git submodule so the parser API is reproducible.
The current rule engine deliberately uses Yuku's native flat AST and semantic traverser instead of converting to ESTree. That keeps the first version small and avoids a JS runtime dependency.
