(params: {
fileName?: string;
text?: string;
options?: TOptions;
})
| 69 | } |
| 70 | |
| 71 | export async function realPluginParams<TOptions = unknown>(params: { |
| 72 | fileName?: string; |
| 73 | text?: string; |
| 74 | options?: TOptions; |
| 75 | }): Promise<PluginParams<TOptions>> { |
| 76 | const { fileName = 'file.ts', text = '', options = {} } = params; |
| 77 | |
| 78 | const project = await createProject({ |
| 79 | compilerOptions: { |
| 80 | strict: true, |
| 81 | }, |
| 82 | useInMemoryFileSystem: true, |
| 83 | }); |
| 84 | const sourceFile = project.createSourceFile(fileName, text); |
| 85 | |
| 86 | const getLanguageService = () => project.getLanguageService(); |
| 87 | |
| 88 | return { |
| 89 | options: options as unknown as TOptions, |
| 90 | fileName, |
| 91 | rootDir: __dirname, |
| 92 | text, |
| 93 | sourceFile, |
| 94 | getLanguageService, |
| 95 | }; |
| 96 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…