MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / lintSubComp

Function lintSubComp

packages/lint/src/project.test.ts:65–75  ·  view source on GitHub ↗
(
    srcPath: string,
    subCompFiles?: Record<string, string>,
  )

Source from the content-addressed store, hash-verified

63 // (or a custom srcPath) and return the missing_or_empty_sub_composition
64 // finding, if any, plus the raw lint result for callers that need totalErrors.
65 async function lintSubComp(
66 srcPath: string,
67 subCompFiles?: Record<string, string>,
68 ): Promise<{ finding: HyperframeLintFinding | undefined; totalErrors: number }> {
69 const project = makeProject(htmlWithSubComp(srcPath), subCompFiles);
70 const { totalErrors, results } = await lintProject(project);
71 const finding = results
72 .flatMap((r) => r.result.findings)
73 .find((f) => f.code === "missing_or_empty_sub_composition");
74 return { finding, totalErrors };
75 }
76
77 it.each([
78 {

Callers 1

project.test.tsFile · 0.70

Calls 4

lintProjectFunction · 0.85
makeProjectFunction · 0.70
htmlWithSubCompFunction · 0.70
findMethod · 0.65

Tested by

no test coverage detected