Skip to content

Commit

Permalink
chore: include "rootDirs" when transferring compiler options (#1248)
Browse files Browse the repository at this point in the history
  • Loading branch information
nayeemrmn authored Jan 30, 2025
1 parent 6ce6ee6 commit eb61b06
Showing 1 changed file with 38 additions and 36 deletions.
74 changes: 38 additions & 36 deletions client/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,10 @@ async function maybeShowTsConfigPrompt(
if (!isObject(compilerOptions)) {
return;
}
for (const key of UNSUPPORTED_COMMON_COMPILER_OPTIONS) {
delete compilerOptions[key];
for (const key in compilerOptions) {
if (!ALLOWED_COMPILER_OPTIONS.includes(key)) {
delete compilerOptions[key];
}
}
if (Object.entries(compilerOptions).length == 0) {
return;
Expand Down Expand Up @@ -719,40 +721,40 @@ function isDenoDisabledCompletely(): boolean {
).every(isScopeDisabled);
}

const UNSUPPORTED_COMMON_COMPILER_OPTIONS = [
"baseUrl",
"composite",
"declaration",
"declarationDir",
"declarationMap",
"emitBOM",
"emitDeclarationOnly",
// Keep this in sync with the supported compiler options set in CLI. Currently:
// https://github.com/denoland/deno_config/blob/0.47.1/src/deno_json/ts.rs#L85-L119
const ALLOWED_COMPILER_OPTIONS = [
"allowUnreachableCode",
"allowUnusedLabels",
"checkJs",
"emitDecoratorMetadata",
"generateCpuProfile",
"importHelpers",
"incremental",
"inlineSourceMap",
"inlineSources",
"moduleResolution",
"newLine",
"noEmit",
"noEmitHelpers",
"noEmitOnError",
"outDir",
"outFile",
"paths",
"preserveSymlinks",
"preserveWatchOutput",
"removeComments",
"rootDir",
"exactOptionalPropertyTypes",
"experimentalDecorators",
"isolatedDeclarations",
"jsx",
"jsxFactory",
"jsxFragmentFactory",
"jsxImportSource",
"jsxPrecompileSkipElements",
"lib",
"noErrorTruncation",
"noFallthroughCasesInSwitch",
"noImplicitAny",
"noImplicitOverride",
"noImplicitReturns",
"noImplicitThis",
"noPropertyAccessFromIndexSignature",
"noUncheckedIndexedAccess",
"noUnusedLocals",
"noUnusedParameters",
"rootDirs",
"skipLibCheck",
"sourceMap",
"sourceRoot",
"stripInternal",
"tsBuildInfoFile",
"typeRoots",
"watch",
"watchDirectory",
"watchFile",
"strict",
"strictBindCallApply",
"strictBuiltinIteratorReturn",
"strictFunctionTypes",
"strictNullChecks",
"strictPropertyInitialization",
"types",
"useUnknownInCatchVariables",
"verbatimModuleSyntax",
];

0 comments on commit eb61b06

Please sign in to comment.