MCPcopy
hub / github.com/airbnb/ts-migrate / realPluginParams

Function realPluginParams

packages/ts-migrate-plugins/tests/test-utils.ts:71–96  ·  view source on GitHub ↗
(params: {
  fileName?: string;
  text?: string;
  options?: TOptions;
})

Source from the content-addressed store, hash-verified

69}
70
71export 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}

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…