Merge pull request #11070 from zhengbli/allowSynthetic

set allowSyntheticDefaultImports to true by default for jsconfig.json
This commit is contained in:
Zhengbo Li 2016-09-22 17:13:31 -07:00 committed by GitHub
commit ff082eb617
2 changed files with 9 additions and 3 deletions

View File

@ -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;
}

View File

@ -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[]>[]
}