style: format (#28995)

PR Close #28995
This commit is contained in:
Greg Magolan 2019-02-26 15:38:40 -08:00 committed by Ben Lesh
parent c4c3c1231b
commit 7b944c46d3
1 changed files with 31 additions and 30 deletions

View File

@ -60,11 +60,9 @@ export function runOneBuild(args: string[], inputs?: {[path: string]: string}):
// `angularCompilerOptions` will be considered. As this code is going to be // `angularCompilerOptions` will be considered. As this code is going to be
// removed with Ivy, the added complication of handling recursive extends // removed with Ivy, the added complication of handling recursive extends
// is likely not needed. // is likely not needed.
let userConfigFile = let userConfigFile = resolveNormalizedPath(path.dirname(project), config['extends']);
resolveNormalizedPath(path.dirname(project), config['extends']);
if (!userConfigFile.endsWith('.json')) userConfigFile += '.json'; if (!userConfigFile.endsWith('.json')) userConfigFile += '.json';
const {config: userConfig, error} = const {config: userConfig, error} = ts.readConfigFile(userConfigFile, ts.sys.readFile);
ts.readConfigFile(userConfigFile, ts.sys.readFile);
if (error) { if (error) {
console.error(ng.formatDiagnostics([error])); console.error(ng.formatDiagnostics([error]));
return false; return false;
@ -73,37 +71,40 @@ export function runOneBuild(args: string[], inputs?: {[path: string]: string}):
// All user angularCompilerOptions values that a user has control // All user angularCompilerOptions values that a user has control
// over should be collected here // over should be collected here
if (userConfig.angularCompilerOptions) { if (userConfig.angularCompilerOptions) {
angularCompilerOptions.diagnostics = angularCompilerOptions.diagnostics || angularCompilerOptions.diagnostics =
userConfig.angularCompilerOptions.diagnostics; angularCompilerOptions.diagnostics || userConfig.angularCompilerOptions.diagnostics;
angularCompilerOptions.trace = angularCompilerOptions.trace || angularCompilerOptions.trace =
userConfig.angularCompilerOptions.trace; angularCompilerOptions.trace || userConfig.angularCompilerOptions.trace;
angularCompilerOptions.disableExpressionLowering = angularCompilerOptions.disableExpressionLowering || angularCompilerOptions.disableExpressionLowering =
userConfig.angularCompilerOptions.disableExpressionLowering; angularCompilerOptions.disableExpressionLowering ||
angularCompilerOptions.disableTypeScriptVersionCheck = angularCompilerOptions.disableTypeScriptVersionCheck || userConfig.angularCompilerOptions.disableExpressionLowering;
userConfig.angularCompilerOptions.disableTypeScriptVersionCheck; angularCompilerOptions.disableTypeScriptVersionCheck =
angularCompilerOptions.disableTypeScriptVersionCheck ||
userConfig.angularCompilerOptions.disableTypeScriptVersionCheck;
angularCompilerOptions.i18nOutLocale = angularCompilerOptions.i18nOutLocale || angularCompilerOptions.i18nOutLocale =
userConfig.angularCompilerOptions.i18nOutLocale; angularCompilerOptions.i18nOutLocale || userConfig.angularCompilerOptions.i18nOutLocale;
angularCompilerOptions.i18nOutFormat = angularCompilerOptions.i18nOutFormat || angularCompilerOptions.i18nOutFormat =
userConfig.angularCompilerOptions.i18nOutFormat; angularCompilerOptions.i18nOutFormat || userConfig.angularCompilerOptions.i18nOutFormat;
angularCompilerOptions.i18nOutFile = angularCompilerOptions.i18nOutFile || angularCompilerOptions.i18nOutFile =
userConfig.angularCompilerOptions.i18nOutFile; angularCompilerOptions.i18nOutFile || userConfig.angularCompilerOptions.i18nOutFile;
angularCompilerOptions.i18nInFormat = angularCompilerOptions.i18nInFormat || angularCompilerOptions.i18nInFormat =
userConfig.angularCompilerOptions.i18nInFormat; angularCompilerOptions.i18nInFormat || userConfig.angularCompilerOptions.i18nInFormat;
angularCompilerOptions.i18nInLocale = angularCompilerOptions.i18nInLocale || angularCompilerOptions.i18nInLocale =
userConfig.angularCompilerOptions.i18nInLocale; angularCompilerOptions.i18nInLocale || userConfig.angularCompilerOptions.i18nInLocale;
angularCompilerOptions.i18nInFile = angularCompilerOptions.i18nInFile || angularCompilerOptions.i18nInFile =
userConfig.angularCompilerOptions.i18nInFile; angularCompilerOptions.i18nInFile || userConfig.angularCompilerOptions.i18nInFile;
angularCompilerOptions.i18nInMissingTranslations = angularCompilerOptions.i18nInMissingTranslations || angularCompilerOptions.i18nInMissingTranslations =
userConfig.angularCompilerOptions.i18nInMissingTranslations; angularCompilerOptions.i18nInMissingTranslations ||
angularCompilerOptions.i18nUseExternalIds = angularCompilerOptions.i18nUseExternalIds || userConfig.angularCompilerOptions.i18nInMissingTranslations;
userConfig.angularCompilerOptions.i18nUseExternalIds; angularCompilerOptions.i18nUseExternalIds = angularCompilerOptions.i18nUseExternalIds ||
userConfig.angularCompilerOptions.i18nUseExternalIds;
angularCompilerOptions.preserveWhitespaces = angularCompilerOptions.preserveWhitespaces || angularCompilerOptions.preserveWhitespaces = angularCompilerOptions.preserveWhitespaces ||
userConfig.angularCompilerOptions.preserveWhitespaces; userConfig.angularCompilerOptions.preserveWhitespaces;
} }
} }