Editors, CI and agents
Output for other tools
--format jsonprints{ "version": 1, "tool": {...}, "findings": [...] }, described byoutput.schema.json(optilint --print-schema output). Each finding has itsgroup,impact, optionalseverity, start and end positions, andfix: { tier, assumes?, obscure?, edits } | null. Edit offsets count UTF-16 code units, as editors do.--format githubprints one workflow command per finding (::warning file=…,line=…::message), which GitHub Actions shows as annotations on the run and on the PR diff, with no code scanning setup. A finding'sseveritypicks error, warning or notice; without one, high and medium impact are warnings and low is a notice.--format sarifprints SARIF 2.1.0 with fixes as replacements, for GitHub code scanning and other SARIF viewers.--list-rules --format jsonprints every rule's metadata.--stdin-filename path/to/file.tslints stdin as that file; with--fixit prints the fixed text. Editors use this for unsaved buffers.- The exit code is 1 when findings remain (findings set to
infodo not count) and 2 on usage errors.
GitHub Actions
optilint-action runs optilint on a pull request and shows its findings as annotations on the diff:
yaml
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: tjagithub/optilint-action@v0Inputs: paths, version, working-directory, min-impact, fail-on (findings, error or never), sarif (also upload to code scanning; needs security-events: write) and args. It only reports; apply fixes where you can review them.
VS Code
The optilint extension shows findings as diagnostics with quick fixes, adds a fix-all command and a sidebar grouped by tier, and gives optilint.json completion. It ships its own copy of optilint.
Coding agents
- Skill:
skills/optilint/SKILL.md(Agent Skills format) teaches an agent the tiers: apply exact and typed fixes, check each assumed fix's assumption first, and leave report-only findings unless the code is hot. The repo is also a Claude Code plugin (.claude-plugin/plugin.json) that ships just this skill. - MCP server:
optilint --mcpserves three tools on stdio:lint(files or a code snippet),fix(returns fixed text or a diff; writes files only withwrite: true) andrules. Paths must be inside the directory it runs in. Add it to Claude Code withclaude mcp add optilint -- npx -y @optilint/cli --mcp. - The VS Code extension registers both for Copilot and other VS Code agents.
An agent with a shell does as well with the CLI and the skill, and does not pay for the MCP tool descriptions in every session.