Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit c776229

Browse files
authored
foce overwrite deno's tsconfig (#32)
1 parent d348ada commit c776229

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ module.exports = function init({ typescript }: { typescript: typeof ts_module })
3535
typeRoots: [],
3636
};
3737

38+
const OPTIONS_OVERWRITE_BY_DENO: ts_module.CompilerOptions = {
39+
jsx: OPTIONS.jsx,
40+
module: OPTIONS.module,
41+
moduleResolution: OPTIONS.moduleResolution,
42+
resolveJsonModule: OPTIONS.resolveJsonModule,
43+
strict: OPTIONS.strict,
44+
noEmit: OPTIONS.noEmit,
45+
noEmitHelpers: OPTIONS.noEmitHelpers,
46+
target: typescript.ScriptTarget.ESNext,
47+
};
48+
3849
return {
3950
create(info: ts_module.server.PluginCreateInfo): ts_module.LanguageService {
4051
logger = Logger.forPlugin(info);
@@ -71,7 +82,7 @@ module.exports = function init({ typescript }: { typescript: typeof ts_module })
7182

7283
info.languageServiceHost.getCompilationSettings = () => {
7384
const projectConfig = getCompilationSettings.call(info.languageServiceHost);
74-
const compilationSettings = merge(OPTIONS, projectConfig);
85+
const compilationSettings = merge(merge(OPTIONS, projectConfig), OPTIONS_OVERWRITE_BY_DENO);
7586
logger.info(`compilationSettings:${JSON.stringify(compilationSettings)}`);
7687
return compilationSettings;
7788
};

0 commit comments

Comments
 (0)