📄 createProjectProgram.ts¶
📊 Analysis Summary¶
| Metric | Count |
|---|---|
| 🔧 Functions | 1 |
| 📦 Imports | 6 |
📚 Table of Contents¶
🛠️ File Location:¶
📂 packages/typescript-estree/src/create-program/createProjectProgram.ts
📦 Imports¶
| Name | Source |
|---|---|
debug |
debug |
ParseSettings |
../parseSettings |
ASTAndDefiniteProgram |
./shared |
firstDefined |
../node-utils |
createProjectProgramError |
./createProjectProgramError |
getAstFromProgram |
./shared |
Functions¶
createProjectProgram(parseSettings: ParseSettings, programsForProjects: readonly ts.Program[]): ASTAndDefiniteProgram¶
Code
export function createProjectProgram(
parseSettings: ParseSettings,
programsForProjects: readonly ts.Program[],
): ASTAndDefiniteProgram {
log('Creating project program for: %s', parseSettings.filePath);
const astAndProgram = firstDefined(programsForProjects, currentProgram =>
getAstFromProgram(currentProgram, parseSettings.filePath),
);
if (!astAndProgram) {
throw new Error(
createProjectProgramError(parseSettings, programsForProjects).join('\n'),
);
}
return astAndProgram;
}
-
JSDoc:
-
Parameters:
parseSettings: ParseSettingsprogramsForProjects: readonly ts.Program[]- Return Type:
ASTAndDefiniteProgram - Calls:
logfirstDefined (from ../node-utils)getAstFromProgram (from ./shared)createProjectProgramError(parseSettings, programsForProjects).join