[Bug] broken-image still fires on `<img>` inside a JSX line comment in some valid .tsx files (engine 0.1.6)

Author: nichiahungCreated Sep 26, 2026Updated Sep 26, 2026
Labelsneeds triage

What happened?

broken-image reports an <img> that only appears in a // comment inside a JSX expression. This looks like #486 / #771, which were closed as fixed, but it still reproduces on engine 0.1.6 (the latest engine release).

Whether it fires depends on the rest of the file. The repro below triggers it. Removing either the <dt> or the <dd> line makes the finding go away. Swapping the fragment and dt/dd for div/span still triggers it. Appending <p>x</p> to the <dd> line also clears it. The comment is also the only cause: rewording it to // Plain img tag: … clears the finding in every variant.

Steps to reproduce

  1. Save as repro.tsx:
typescript
function Row({ label, value }: { label: string; value: string }) {
  return (
    <>
      <dt>{label}</dt>
      <dd>{value}</dd>
    </>
  );
}

function Thumb({ url }: { url?: string }) {
  return (
    <div>
      {url ? (
        // Plain <img>: presigned thumbnail URL
        <img src={url} alt="" />
      ) : null}
    </div>
  );
}
  1. Run impeccable detect --json --no-config repro.tsx
  2. Output:
json
[
  {
    "antipattern": "broken-image",
    "severity": "warning",
    "category": "quality",
    "line": 14,
    "snippet": "<img>"
  }
]

Expected behavior

No finding. Line 14 is a comment, and the real <img> on line 15 has a src.

Provider & environment

  • Provider: Claude Code (the Codex hook also reproduces it through impeccable.cmd)
  • Provider version: Claude Code 2.1.281
  • Impeccable: skill 4.4.0 from main @ 9d715cc, engine 0.1.6 (from the engine-v0.1.6 release, sha256 verified by the launcher)
  • OS: Windows 11 (Git Bash launcher)

Additional context

  • I found it in a real Next.js page where the hook re-reported the finding after every edit to that file. I've suppressed it with a file-scoped ignore-value broken-image "*" --file … for now.
  • The file is LF and ASCII.
  • Several other .tsx files in the same app use the same {cond ? (<img src={x} />) : …} pattern without the comment and don't trigger it. Simpler single-component versions of this repro don't trigger it either, so the comment stripping seems to apply only some of the time.

Willing to work on a fix?

No, but happy to test a fix.

Drafted with Claude Code; the repro and outputs above were run locally.