mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-26 20:14:05 -05:00
Merge pull request #11764 from Microsoft/vladima/11744
watch configuration files if they exist even if they cannot be parsed
This commit is contained in:
@@ -135,10 +135,12 @@ namespace ts.JsTyping {
|
||||
* Get the typing info from common package manager json files like package.json or bower.json
|
||||
*/
|
||||
function getTypingNamesFromJson(jsonPath: string, filesToWatch: string[]) {
|
||||
if (host.fileExists(jsonPath)) {
|
||||
filesToWatch.push(jsonPath);
|
||||
}
|
||||
const result = readConfigFile(jsonPath, (path: string) => host.readFile(path));
|
||||
if (result.config) {
|
||||
const jsonConfig: PackageJson = result.config;
|
||||
filesToWatch.push(jsonPath);
|
||||
if (jsonConfig.dependencies) {
|
||||
mergeTypings(getOwnKeys(jsonConfig.dependencies));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user