Skip to content

Incorrect documentation on the default value for allowSyntheticDefaultImports in https://www.typescriptlang.org/tsconfig. #53509

@kimamula

Description

@kimamula

Bug Report

🔎 Search Terms

allowSyntheticDefaultImports

🕗 Version & Regression Information

  • TypeScript 5.0.2

I could not find this in GitHub but in the locally imported typescript package, getAllowSyntheticDefaultImports is implemented as follows:

function getAllowSyntheticDefaultImports(compilerOptions) {
  if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
    return compilerOptions.allowSyntheticDefaultImports;
  }
  return getESModuleInterop(compilerOptions) || getEmitModuleKind(compilerOptions) === 4 /* System */ || getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
}

🙁 Actual behavior

https://www.typescriptlang.org/tsconfig#allowSyntheticDefaultImports says that the default value for allowSyntheticDefaultImports is:

true if module is system, or esModuleInterop and module is not es6/es2015 or esnext,,false otherwise.

🙂 Expected behavior

According to the implementation (and the behavior I can observe in my project), the actual default value for allowSyntheticDefaultImports is:

true if module is system, esModuleInterop, or moduleResolution is bundler, false otherwise.

Metadata

Metadata

Assignees

Labels

DocsThe issue relates to how you learn TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions