Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d4703e1

Browse files
authored
fix(typescript-estree): ensure parent pointers are set (typescript-eslint#1129)
1 parent 5ae286e commit d4703e1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/typescript-estree/src/create-program/createWatchProgram.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import fs from 'fs';
33
import path from 'path';
44
import ts from 'typescript';
55
import { Extra } from '../parser-options';
6-
import { WatchCompilerHostOfConfigFile } from '../WatchCompilerHostOfConfigFile';
6+
import { WatchCompilerHostOfConfigFile } from './WatchCompilerHostOfConfigFile';
77
import {
88
canonicalDirname,
99
CanonicalPath,
@@ -160,7 +160,13 @@ function getProgramsForProjects(
160160

161161
if (fileList.has(filePath)) {
162162
log('Found existing program for file. %s', filePath);
163-
return [updatedProgram || existingWatch.getProgram().getProgram()];
163+
164+
updatedProgram =
165+
updatedProgram || existingWatch.getProgram().getProgram();
166+
// sets parent pointers in source files
167+
updatedProgram.getTypeChecker();
168+
169+
return [updatedProgram];
164170
}
165171
}
166172
log(

0 commit comments

Comments
 (0)