The TS/JS parser only records an import when from "..." is on the same line as import. When an import spans multiple lines, the from "..." ends up alone on the closing } line, and that line never gets parsed as an import. The dependency is silently dropped.
This hits almost every formatted codebase, since Prettier and Biome both wrap imports like this:
import {
a,
b,
} from "./thing.ts";
codedb deps file.ts --depends-on shows nothing for ./thing.ts. Single-line imports work. Multi-line ones disappear.
Cause: parseTsLine only looks for the string literal on lines that contain import . The } from "..." continuation line doesn't, so it falls through. The Go parser already tracks multi-line import blocks. TS has no equivalent.
The TS/JS parser only records an import when
from "..."is on the same line asimport. When an import spans multiple lines, thefrom "..."ends up alone on the closing}line, and that line never gets parsed as an import. The dependency is silently dropped.This hits almost every formatted codebase, since Prettier and Biome both wrap imports like this:
codedb deps file.ts --depends-onshows nothing for./thing.ts. Single-line imports work. Multi-line ones disappear.Cause:
parseTsLineonly looks for the string literal on lines that containimport. The} from "..."continuation line doesn't, so it falls through. The Go parser already tracks multi-line import blocks. TS has no equivalent.