Lines 180-220javascript
180 packageScripts: { status: "CHECKED", matched: false },
181 knownConfigs: { status: "CHECKED", filesScanned: configTexts.size, matched: false },
182 frameworkPeerContract: "NOT_FOUND",
183 implicitCompilerInput: "NOT_FOUND",
184 dynamicOrPluginUsage: "NOT_PROVEN_ABSENT",
185 decision: "REVIEW_REQUIRED",
187 fixHint: `Review manifest/config/plugin usage; if confirmed unused, remove ${name} with the package manager and run targeted tests`,
193 // ---- missing (phantom) dependencies: imported but declared nowhere ----
194 for (const [name, use] of usedPackages) {
195 if (allDeclared.has(name) || name === selfName || workspacePkgNames.has(name)) continue;
196 const files = [...use.files];
197 if (files.every(isNonRuntimeFile) || isGeneratedNapiPackage(name, files)) continue;
198 const testOnly = files.every((f) => /(^|[/\\])(test|tests|__tests__|spec|e2e|__mocks__)([/\\]|$)|[._-](test|spec)\.[a-z]+$/i
199 const stylesheetOnly = [...use.specs].length > 0 && [...use.specs].every(isStylesheetSpecifier);
200 const usageReason = stylesheetOnly
201 ? `Direct stylesheet import(s) resolve through "${name}"; CSS-only imports are build/runtime inputs even without JavaScript bindings.`
202 : use.typeOnly
MediumDynamic Require
Package source references dynamic require/import behavior.
src/analysis/dep-check.jsView on unpkg · L200 203 ? `Direct type-only import(s) resolve through "${name}"; the compiler still requires a declared package.`
204 : `Direct source import(s) resolve through "${name}", but the nearest package manifest does not declare it.`;
205 findings.push(makeFinding({
208 severity: testOnly ? "low" : "medium",
210 title: `Missing dependency: ${name}`,
212 detail: `"${name}" is imported by ${files.length} file(s) in scope ${meta.scope} but not declared in ${manifest} — it only works via a transitive install (phantom dependency) and can break on any lockfile change.`,
215 line: use.lines.get(files[0]) || 0,
216 evidence: files.slice(0, 5).map((f) => ({ file: f, line: use.lines.get(f) || 0, snippet: "" })),
218 actionability: "STRONG_MANIFEST_MISMATCH",