@utoo/lint
v0.1.3
Published
Experimental JavaScript and TypeScript linter powered by Yuku
Downloads
1,590
Readme
@utoo/lint
High performance linter for JavaScript and TypeScript written by Zig.
Install
pnpm add -D @utoo/lintCLI
Run the linter with:
pnpm exec utoo-lint srcIf no target is provided, utoo-lint uses files from utoo.json or
utoo-lint.json. When no config file or files entry exists, it scans the
current directory. It skips .git, .zig-cache, node_modules, vendor, and
zig-out.
Use a config file:
pnpm exec utoo-lint --config=utoo.json srcRun a focused rule set:
pnpm exec utoo-lint --rules=no-debugger,no-console srcUse machine-readable output:
pnpm exec utoo-lint --format=json srcConfiguration
Create a utoo.json file:
{
"$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"
}
}Start from the packaged frontend template:
cp node_modules/@utoo/lint/configs/frontend.json utoo.jsonESLint Migration
Convert an existing ESLint config into the native utoo format:
pnpm exec utoo-lint migrate eslint --from eslint.config.js --output utoo.jsonThe package also provides compatibility bins for common replacement flows:
pnpm exec eslint --config utoo.json src
pnpm exec fishlint eslint --disable-setup --config utoo.json --glob srcJavaScript API
import { lintFiles } from "@utoo/lint";
const report = lintFiles(["src"], {
config: "utoo.json",
rules: ["no-debugger"]
});
console.log(report.diagnostics);Calling lintFiles() without patterns follows the same default target behavior
as the CLI, so migration scripts usually do not need to expand config files
manually.
CommonJS is supported through require("@utoo/lint").
Binary Resolution
@utoo/lint installs a platform-specific optional dependency containing the
native utoo-lint binary. Set UTOO_LINT_BIN=/path/to/utoo-lint to force a
specific binary during local development.
