mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-18 12:21:37 -06:00
Remove handling for multiple inheritance for config files
This commit is contained in:
parent
19f62a41de
commit
d8ff546512
@ -822,17 +822,8 @@ namespace ts {
|
||||
if (typeof json["extends"] === "string") {
|
||||
[include, exclude, files, baseOptions] = (tryExtendsName(json["extends"]) || [include, exclude, files, baseOptions]);
|
||||
}
|
||||
else if (typeof json["extends"] === "object" && json["extends"].length) {
|
||||
for (const name of json["extends"]) {
|
||||
const [tempinclude, tempexclude, tempfiles, tempBase]: [string[], string[], string[], CompilerOptions] = (tryExtendsName(name) || [include, exclude, files, baseOptions]);
|
||||
include = tempinclude || include;
|
||||
exclude = tempexclude || exclude;
|
||||
files = tempfiles || files;
|
||||
baseOptions = assign({}, baseOptions, tempBase);
|
||||
}
|
||||
}
|
||||
else {
|
||||
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", "string or string[]"));
|
||||
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", "string"));
|
||||
}
|
||||
if (include && !json["include"]) {
|
||||
json["include"] = include;
|
||||
|
||||
@ -15,18 +15,6 @@ namespace ts {
|
||||
"compilerOptions": {
|
||||
"strictNullChecks": false
|
||||
}
|
||||
}`,
|
||||
"/dev/tsconfig.tests.json": `{
|
||||
"extends": ["./configs/tests", "./tsconfig"],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs"
|
||||
}
|
||||
}`,
|
||||
"/dev/tsconfig.tests.browser.json": `{
|
||||
"extends": ["./configs/tests", "./tsconfig"],
|
||||
"compilerOptions": {
|
||||
"module": "amd"
|
||||
}
|
||||
}`,
|
||||
"/dev/configs/base.json": `{
|
||||
"compilerOptions": {
|
||||
@ -75,12 +63,6 @@ namespace ts {
|
||||
}`,
|
||||
"/dev/failure2.json": `{
|
||||
"excludes": ["*.js"]
|
||||
}`,
|
||||
"/dev/multi.json": `{
|
||||
"extends": ["./configs/first", "./configs/second"],
|
||||
"compilerOptions": {
|
||||
"allowJs": false
|
||||
}
|
||||
}`,
|
||||
"/dev/configs/first.json": `{
|
||||
"extends": "./base",
|
||||
@ -168,31 +150,6 @@ namespace ts {
|
||||
combinePaths(basePath, "supplemental.ts"),
|
||||
]);
|
||||
|
||||
testSuccess("can resolve an extension with a multiple base extensions that overrides options", "tsconfig.tests.json", {
|
||||
allowJs: true,
|
||||
noImplicitAny: true,
|
||||
strictNullChecks: true,
|
||||
preserveConstEnums: true,
|
||||
removeComments: false,
|
||||
sourceMap: true,
|
||||
module: ts.ModuleKind.CommonJS,
|
||||
}, [
|
||||
combinePaths(basePath, "main.ts"),
|
||||
combinePaths(basePath, "supplemental.ts"),
|
||||
combinePaths(basePath, "tests/unit/spec.ts"),
|
||||
combinePaths(basePath, "tests/utils.ts"),
|
||||
]);
|
||||
|
||||
testSuccess("can resolve a diamond dependency graph", "multi.json", {
|
||||
allowJs: false,
|
||||
noImplicitAny: true,
|
||||
strictNullChecks: true,
|
||||
module: ts.ModuleKind.AMD,
|
||||
}, [
|
||||
combinePaths(basePath, "configs/../main.ts"), // Probably should consider resolving these kinds of paths when they appear
|
||||
combinePaths(basePath, "supplemental.ts"),
|
||||
]);
|
||||
|
||||
testFailure("can report errors on circular imports", "circular.json", [
|
||||
{
|
||||
code: 18000,
|
||||
@ -213,10 +170,10 @@ namespace ts {
|
||||
messageText: `Unknown option 'excludes'. Did you mean 'exclude'?`
|
||||
}]);
|
||||
|
||||
testFailure("can error when 'extends' is neither a string nor a string[]", "extends.json", [{
|
||||
testFailure("can error when 'extends' is not a string", "extends.json", [{
|
||||
code: 5024,
|
||||
category: DiagnosticCategory.Error,
|
||||
messageText: `Compiler option 'extends' requires a value of type string or string[].`
|
||||
messageText: `Compiler option 'extends' requires a value of type string.`
|
||||
}]);
|
||||
|
||||
testFailure("can error when 'extends' is neither relative nor rooted.", "extends2.json", [{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user