optilint for VS Code
Shows optilint performance findings for JavaScript and TypeScript in the Problems panel, with quick fixes.
optilint type-checks your code with the TypeScript compiler, and every fix has a tier: exact (same behaviour for every input), typed (for every input the types allow) or assumed (only if a stated assumption holds). Assumed fixes show their assumption in the quick-fix title, and obscure ones (correct but hard to read, like x | 0) are marked too.
Requirements
None. The extension bundles the optilint CLI and runs it on VS Code's own Node. Set optilint.path to run another copy instead, such as a development checkout.
Features
Lints open files as you type (debounced), and on demand with optilint: Lint Workspace.
Quick fixes: apply one fix, disable the rule for one line, or explain the rule.
source.fixAll.optilint runs the multi-pass fixer on the file. To use it on save:
"editor.codeActionsOnSave": { "source.fixAll.optilint": "explicit" }
Fix Workspace applies fixes up to the config's tier to files on disk; Fix Workspace (Including Assumed and Obscure Fixes) applies all of them.
optilint.json and optilint.jsonc (comments allowed in both), and the "optilint" key of package.json, get completion, hover docs and validation from the installed CLI's own schema, so rule names always match its version.
A sidebar (the gauge in the activity bar) groups findings by fix tier (Exact, Typed, Assumed, Report only), then by rule. The wand on a tier or rule applies its fixes in the open buffers, unsaved, so you can review them; hover a finding to see what an assumed fix assumes.
Copilot and other VS Code agents get optilint's MCP tools (lint, fix, rules) and a skill that explains the tiers, with nothing to set up. Turn the server off under MCP: List Servers.
A status bar item counts findings by impact.
Settings
| Setting |
Default |
|
optilint.path |
bundled |
Another optilint executable to run. |
optilint.minImpact |
from config |
Hide findings below this impact. |
optilint.severity.high / .medium / .low |
warning / information / hint |
Severity per impact, or off, for rules the config gives no level. |
optilint.lintOnType |
true |
Lint unsaved edits. |
optilint.lintWorkspaceOnStartup |
false |
Lint every file on startup. |
optilint.fixTier |
from config |
The highest tier "fix all" applies. |
optilint.timeout |
60000 |
Kill a run after this many ms. |
optilint.extraArgs |
[] |
Extra CLI arguments, as --option=value. |
Project config (optilint.json or optilint.jsonc, found by searching upward from each file) and // optilint-disable-next-line rule comments work as on the command line; a level set there (info, warn, error) decides the diagnostic's severity.
In an untrusted workspace, optilint.path and optilint.extraArgs from workspace settings are ignored.