@jsdocs-io/extractor
Version:
Analyze and extract the API from npm packages
23 lines (19 loc) • 563 B
text/typescript
import * as tsm from 'ts-morph';
export function getProject({
fileSystem,
pattern = '**/*.ts',
}: {
fileSystem: tsm.FileSystemHost;
pattern?: string;
}): tsm.Project {
const project = new tsm.Project({
fileSystem,
compilerOptions: {
// See https://github.com/dsherret/ts-morph/issues/938
// and https://github.com/microsoft/TypeScript/blob/master/lib/lib.esnext.full.d.ts
lib: ['lib.esnext.full.d.ts'],
},
});
project.addSourceFilesAtPaths(pattern);
return project;
}