mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
Merge branch 'master' into requireJson
This commit is contained in:
@@ -678,6 +678,12 @@ namespace ts {
|
||||
category: Diagnostics.Advanced_Options,
|
||||
description: Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,
|
||||
},
|
||||
{
|
||||
name: "keyofStringsOnly",
|
||||
type: "boolean",
|
||||
category: Diagnostics.Advanced_Options,
|
||||
description: Diagnostics.Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols,
|
||||
},
|
||||
{
|
||||
// A list of plugins to load in the language service
|
||||
name: "plugins",
|
||||
@@ -2127,19 +2133,10 @@ namespace ts {
|
||||
});
|
||||
|
||||
function createDiagnostic(message: DiagnosticMessage, spec: string): Diagnostic {
|
||||
const jsonObjectLiteral = getTsConfigObjectLiteralExpression(jsonSourceFile);
|
||||
if (jsonObjectLiteral) {
|
||||
for (const property of getPropertyAssignment(jsonObjectLiteral, specKey)) {
|
||||
if (isArrayLiteralExpression(property.initializer)) {
|
||||
for (const element of property.initializer.elements) {
|
||||
if (isStringLiteral(element) && element.text === spec) {
|
||||
return createDiagnosticForNodeInSourceFile(jsonSourceFile, element, message, spec);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return createCompilerDiagnostic(message, spec);
|
||||
const element = getTsConfigPropArrayElementValue(jsonSourceFile, specKey, spec);
|
||||
return element ?
|
||||
createDiagnosticForNodeInSourceFile(jsonSourceFile, element, message, spec) :
|
||||
createCompilerDiagnostic(message, spec);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user