Skip to content

Commit d8ff546

Browse files
committed
Remove handling for multiple inheritance for config files
1 parent 19f62a4 commit d8ff546

File tree

2 files changed

+3
-55
lines changed

2 files changed

+3
-55
lines changed

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -822,17 +822,8 @@ namespace ts {
822822
if (typeof json["extends"] === "string") {
823823
[include, exclude, files, baseOptions] = (tryExtendsName(json["extends"]) || [include, exclude, files, baseOptions]);
824824
}
825-
else if (typeof json["extends"] === "object" && json["extends"].length) {
826-
for (const name of json["extends"]) {
827-
const [tempinclude, tempexclude, tempfiles, tempBase]: [string[], string[], string[], CompilerOptions] = (tryExtendsName(name) || [include, exclude, files, baseOptions]);
828-
include = tempinclude || include;
829-
exclude = tempexclude || exclude;
830-
files = tempfiles || files;
831-
baseOptions = assign({}, baseOptions, tempBase);
832-
}
833-
}
834825
else {
835-
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", "string or string[]"));
826+
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", "string"));
836827
}
837828
if (include && !json["include"]) {
838829
json["include"] = include;

src/harness/unittests/configurationExtension.ts

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,6 @@ namespace ts {
1515
"compilerOptions": {
1616
"strictNullChecks": false
1717
}
18-
}`,
19-
"/dev/tsconfig.tests.json": `{
20-
"extends": ["./configs/tests", "./tsconfig"],
21-
"compilerOptions": {
22-
"module": "commonjs"
23-
}
24-
}`,
25-
"/dev/tsconfig.tests.browser.json": `{
26-
"extends": ["./configs/tests", "./tsconfig"],
27-
"compilerOptions": {
28-
"module": "amd"
29-
}
3018
}`,
3119
"/dev/configs/base.json": `{
3220
"compilerOptions": {
@@ -75,12 +63,6 @@ namespace ts {
7563
}`,
7664
"/dev/failure2.json": `{
7765
"excludes": ["*.js"]
78-
}`,
79-
"/dev/multi.json": `{
80-
"extends": ["./configs/first", "./configs/second"],
81-
"compilerOptions": {
82-
"allowJs": false
83-
}
8466
}`,
8567
"/dev/configs/first.json": `{
8668
"extends": "./base",
@@ -168,31 +150,6 @@ namespace ts {
168150
combinePaths(basePath, "supplemental.ts"),
169151
]);
170152

171-
testSuccess("can resolve an extension with a multiple base extensions that overrides options", "tsconfig.tests.json", {
172-
allowJs: true,
173-
noImplicitAny: true,
174-
strictNullChecks: true,
175-
preserveConstEnums: true,
176-
removeComments: false,
177-
sourceMap: true,
178-
module: ts.ModuleKind.CommonJS,
179-
}, [
180-
combinePaths(basePath, "main.ts"),
181-
combinePaths(basePath, "supplemental.ts"),
182-
combinePaths(basePath, "tests/unit/spec.ts"),
183-
combinePaths(basePath, "tests/utils.ts"),
184-
]);
185-
186-
testSuccess("can resolve a diamond dependency graph", "multi.json", {
187-
allowJs: false,
188-
noImplicitAny: true,
189-
strictNullChecks: true,
190-
module: ts.ModuleKind.AMD,
191-
}, [
192-
combinePaths(basePath, "configs/../main.ts"), // Probably should consider resolving these kinds of paths when they appear
193-
combinePaths(basePath, "supplemental.ts"),
194-
]);
195-
196153
testFailure("can report errors on circular imports", "circular.json", [
197154
{
198155
code: 18000,
@@ -213,10 +170,10 @@ namespace ts {
213170
messageText: `Unknown option 'excludes'. Did you mean 'exclude'?`
214171
}]);
215172

216-
testFailure("can error when 'extends' is neither a string nor a string[]", "extends.json", [{
173+
testFailure("can error when 'extends' is not a string", "extends.json", [{
217174
code: 5024,
218175
category: DiagnosticCategory.Error,
219-
messageText: `Compiler option 'extends' requires a value of type string or string[].`
176+
messageText: `Compiler option 'extends' requires a value of type string.`
220177
}]);
221178

222179
testFailure("can error when 'extends' is neither relative nor rooted.", "extends2.json", [{

0 commit comments

Comments
 (0)