Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
throw chalk.red(`Cannot find a ${configName} file for ${srcDirectoryPath}`);
}
const formatDiagnosticsHost: ts.FormatDiagnosticsHost = {
getCurrentDirectory,
getCanonicalFileName: getCanonicalPath,
getNewLine: getNewLine
};
const { errors, fileNames, options: tsconfigOptions } = readAndParseConfigFile(tsConfigPath);
if (errors.length) {
throw ts.formatDiagnosticsWithColorAndContext(errors, formatDiagnosticsHost);
}
const canonicalSrcPath = getCanonicalPath(srcDirectoryPath);
const filesInSrcDirectory = fileNames
.map(filePath => ({ filePath, normalizedPath: normalize(filePath) }))
.filter(({ normalizedPath }) => getCanonicalPath(normalizedPath).startsWith(canonicalSrcPath));
const programs: Array<{ folderName: string; program: ts.Program }> = [];
for (const { folderName, getCompilerOptions } of formats) {
const compilerOptions: ts.CompilerOptions = {
...getCompilerOptions(tsconfigOptions),
outDir: undefined,
outFile: undefined,
out: undefined,
noEmit: false
};
programs.push({
.filter(({ normalizedPath }) => getCanonicalPath(normalizedPath).startsWith(canonicalSrcPath));