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

Function lintSubComp

packages/cli/src/utils/lintProject.test.ts:1053–1063  ·  view source on GitHub ↗
(
    srcPath: string,
    subCompFiles?: Record<string, string>,
  )

Source from the content-addressed store, hash-verified

1051 // (or a custom srcPath) and return the missing_or_empty_sub_composition
1052 // finding, if any, plus the raw lint result for callers that need totalErrors.
1053 async function lintSubComp(
1054 srcPath: string,
1055 subCompFiles?: Record<string, string>,
1056 ): Promise<{ finding: HyperframeLintFinding | undefined; totalErrors: number }> {
1057 const project = makeProject(htmlWithSubComp(srcPath), subCompFiles);
1058 const { totalErrors, results } = await lintProject(project);
1059 const finding = results
1060 .flatMap((r) => r.result.findings)
1061 .find((f) => f.code === "missing_or_empty_sub_composition");
1062 return { finding, totalErrors };
1063 }
1064
1065 it.each([
1066 {

Callers 1

Calls 4

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

Tested by

no test coverage detected