From 25c701cd4e6ec807290bcd413a0e835ecb8d49a2 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 28 May 2024 22:06:10 +0200 Subject: [PATCH] Compile in JS-only mode for files ending in ".js" --- packages/ts-plugin/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ts-plugin/src/index.ts b/packages/ts-plugin/src/index.ts index 949fab3..5d028fb 100644 --- a/packages/ts-plugin/src/index.ts +++ b/packages/ts-plugin/src/index.ts @@ -160,7 +160,7 @@ const boot: tslib.server.PluginModuleFactory = ({ typescript: ts }) => { const { text: expandedText, targetToSourceMap, sourceToTargetMap } = compile({ source, name, - typescript: true, + typescript: !name.toLowerCase().endsWith('.js'), emitError: (message, start, end) => { console.error(`${Syntax.formatPos(start)}-${Syntax.formatPos(end)}: ${message}`); diagnostics.push({ message, start, end });