1 | import * as tsm from 'ts-morph';
|
2 |
|
3 | export function getProject({
|
4 | fileSystem,
|
5 | pattern = '**/*.ts',
|
6 | }: {
|
7 | fileSystem: tsm.FileSystemHost;
|
8 | pattern?: string;
|
9 | }): tsm.Project {
|
10 | const project = new tsm.Project({
|
11 | fileSystem,
|
12 | compilerOptions: {
|
13 | // See https://github.com/dsherret/ts-morph/issues/938
|
14 | // and https://github.com/microsoft/TypeScript/blob/master/lib/lib.esnext.full.d.ts
|
15 | lib: ['lib.esnext.full.d.ts'],
|
16 | },
|
17 | });
|
18 |
|
19 | project.addSourceFilesAtPaths(pattern);
|
20 |
|
21 | return project;
|
22 | }
|
23 |
|
\ | No newline at end of file |