fix(compiler-cli): extend angularCompilerOptions in tsconfig from node (#40694)

TypeScript supports non rooted extends, we should do the same

https://github.com/microsoft/TypeScript/blob/b346f5764e4d500ebdeff7086e43690ea533a305/src/compiler/commandLineParser.ts#L2603-L2628

Closes: #36715

PR Close #40694
This commit is contained in:
Alan Agius
2021-02-08 16:35:08 +01:00
committed by Joey Perrott
parent 719f9ef7ac
commit 5eb195416b
2 changed files with 86 additions and 21 deletions
@@ -102,4 +102,38 @@ describe('perform_compile', () => {
annotateForClosureCompiler: false,
}));
});
it('should merge tsconfig "angularCompilerOptions" when extends point to node package', () => {
support.writeFiles({
'tsconfig-level-1.json': `{
"extends": "@angular-ru/tsconfig",
"angularCompilerOptions": {
"enableIvy": false
}
}
`,
'node_modules/@angular-ru/tsconfig/tsconfig.json': `{
"compilerOptions": {
"strict": true
},
"angularCompilerOptions": {
"skipMetadataEmit": true
}
}
`,
'node_modules/@angular-ru/tsconfig/package.json': `{
"name": "@angular-ru/tsconfig",
"version": "0.0.0",
"main": "./tsconfig.json"
}
`,
});
const {options} = readConfiguration(path.resolve(basePath, 'tsconfig-level-1.json'));
expect(options).toEqual(jasmine.objectContaining({
strict: true,
skipMetadataEmit: true,
enableIvy: false,
}));
});
});