mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Merge pull request #11070 from zhengbli/allowSynthetic
set allowSyntheticDefaultImports to true by default for jsconfig.json
This commit is contained in:
commit
ff082eb617
@ -901,7 +901,9 @@ namespace ts {
|
||||
function convertCompilerOptionsFromJsonWorker(jsonOptions: any,
|
||||
basePath: string, errors: Diagnostic[], configFileName?: string): CompilerOptions {
|
||||
|
||||
const options: CompilerOptions = getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true, maxNodeModuleJsDepth: 2 } : {};
|
||||
const options: CompilerOptions = getBaseFileName(configFileName) === "jsconfig.json"
|
||||
? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true }
|
||||
: {};
|
||||
convertOptionsFromJson(optionDeclarations, jsonOptions, basePath, options, Diagnostics.Unknown_compiler_option_0, errors);
|
||||
return options;
|
||||
}
|
||||
|
||||
@ -404,6 +404,7 @@ namespace ts {
|
||||
compilerOptions: <CompilerOptions>{
|
||||
allowJs: true,
|
||||
maxNodeModuleJsDepth: 2,
|
||||
allowSyntheticDefaultImports: true,
|
||||
module: ModuleKind.CommonJS,
|
||||
target: ScriptTarget.ES5,
|
||||
noImplicitAny: false,
|
||||
@ -431,6 +432,7 @@ namespace ts {
|
||||
compilerOptions: <CompilerOptions>{
|
||||
allowJs: false,
|
||||
maxNodeModuleJsDepth: 2,
|
||||
allowSyntheticDefaultImports: true,
|
||||
module: ModuleKind.CommonJS,
|
||||
target: ScriptTarget.ES5,
|
||||
noImplicitAny: false,
|
||||
@ -453,7 +455,8 @@ namespace ts {
|
||||
compilerOptions:
|
||||
{
|
||||
allowJs: true,
|
||||
maxNodeModuleJsDepth: 2
|
||||
maxNodeModuleJsDepth: 2,
|
||||
allowSyntheticDefaultImports: true
|
||||
},
|
||||
errors: [{
|
||||
file: undefined,
|
||||
@ -473,7 +476,8 @@ namespace ts {
|
||||
compilerOptions:
|
||||
{
|
||||
allowJs: true,
|
||||
maxNodeModuleJsDepth: 2
|
||||
maxNodeModuleJsDepth: 2,
|
||||
allowSyntheticDefaultImports: true
|
||||
},
|
||||
errors: <Diagnostic[]>[]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user