Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
feat: support top-level await with typescript 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Feb 7, 2020
1 parent bcceff2 commit cb0e592
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions typescript-deno-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class DenoPlugin implements ts_module.server.PluginModule {
moduleResolution: this.DEFAULT_OPTIONS.moduleResolution,
resolveJsonModule: this.DEFAULT_OPTIONS.resolveJsonModule,
strict: this.DEFAULT_OPTIONS.strict,
target: this.DEFAULT_OPTIONS.target,
noEmit: this.DEFAULT_OPTIONS.noEmit,
noEmitHelpers: this.DEFAULT_OPTIONS.noEmitHelpers
};
Expand Down Expand Up @@ -154,13 +155,10 @@ class DenoPlugin implements ts_module.server.PluginModule {
}

const ignoreCodeMapInDeno: { [k: number]: boolean; } = {
// 2691: true, // can not import module which end with `.ts`
1308: true // support top level await 只允许在异步函数中使用 "await" 表达式
1103: true // ignore `for-await-of` error
};

return diagnostics.filter(v => {
return !ignoreCodeMapInDeno[v.code];
});
return diagnostics.filter(v => !ignoreCodeMapInDeno[v.code]);
};

if (!resolveModuleNames) {
Expand Down

0 comments on commit cb0e592

Please sign in to comment.