Reference

FAQ

Scope, limits, and where iconlens fits next to the tools you already use.

Questions

Does it need a browser or a network?

No. iconlens parses files locally, with no network code, uploads, or telemetry. It runs the same on a laptop, in a container, or in air-gapped CI.

How is the accessible name computed?

Per SVG-AAM priority: aria-labelledby first, then aria-label, then the first child <title>. The first source that yields a non-empty name wins; the rest are ignored.

Can it check inline SVG in HTML or JSX?

No. iconlens targets standalone .svg assets on disk. Inline SVG in markup is out of scope; use an HTML or JSX linter for that.

Does it replace axe-core or Pa11y?

No. It complements them. Browser engines test a rendered DOM; iconlens tests the asset before it reaches the DOM, which is the gap they cannot cover.

How do I fail CI on warnings too?

Run iconlens icons/*.svg --fail-on warning. It affects only the exit code; every issue is still reported and included in SARIF output.

What do the exit codes mean?

1 on any error-severity issue, 0 otherwise, and 2 on bad usage such as no arguments.

Limitations

Static analysis

iconlens is static file analysis. It does not render the graphic, so it cannot compute colour contrast. Name computation follows the SVG-AAM priority order but does not implement every edge of the full specification. Inline SVG in HTML or JSX is out of scope.

How it compares

svglint
A generic XML and attribute linter. It checks accessibility only if you hand-write the rules, and it has no accessible-name computation or dangling-IDREF checks. github.com/simple-icons/svglint
svgo
Actively removes <title> and <desc> by default, so its default preset strips the accessible name out of the asset. github.com/svg/svgo
axe-core / Pa11y
Need a live DOM and a browser, so they cannot audit an asset file sitting on disk before it ships. github.com/dequelabs/axe-core
Biome noSvgWithoutTitle
A single rule that only covers inline HTML or JSX. It never sees a standalone .svg file on its own. biomejs.dev
W3C ACT 7d6734
Defines the accessible-name test precisely, but ships no implementation you can actually run in CI. w3.org ACT rule 7d6734