Skip to content

Commit

Permalink
fix(helper): change default tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
TomokiMiyauci committed Jan 2, 2022
1 parent 4539b5a commit c776e56
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions helper/_option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ function makeCompilerOption(): CompilerOptions {
return {
esModuleInterop: true,
module: ts.ModuleKind.ESNext,
target: ts.ScriptTarget.ESNext,
lib: ["dom", "esnext"],
target: ts.ScriptTarget.ES2021,
skipLibCheck: false,
noEmit: true,
};
Expand All @@ -32,23 +31,15 @@ function makeHostOption(
return {
readFile,
useCaseSensitiveFileNames,
getDefaultLibFileName: () => "/lib.deno.d.ts",
getDefaultLibFileName: () => "/lib.d.ts",
getCurrentDirectory,
getCanonicalFileName,
getSourceFile: (fileName, lang) => {
const dtsPath = `/lib.${fileName.slice(1)}`;
if (libMap.has(dtsPath)) {
return ts.createSourceFile(dtsPath, libMap.get(dtsPath)!, lang);
}
if (libMap.has(fileName)) {
return ts.createSourceFile(fileName, libMap.get(fileName)!, lang);
}
try {
const sourceText = Deno.readTextFileSync(fileName);
return ts.createSourceFile(fileName, sourceText, lang);
} catch {
return;
}
const sourceText = Deno.readTextFileSync(fileName);
return ts.createSourceFile(fileName, sourceText, lang);
},
directoryExists,
fileExists,
Expand Down

0 comments on commit c776e56

Please sign in to comment.