Skip to content

Commit

Permalink
fix: ensure the parent property exists on TS nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Dec 10, 2018
1 parent 5727f49 commit e065193
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/create-program.js
Expand Up @@ -6,6 +6,10 @@ const createProgram = filepath => {
target: ts.ScriptTarget.Latest,
jsx: "preserve",
});

// This ensures the `parent` property of every node exists. More info here: https://github.com/Microsoft/TypeScript/issues/14464#issuecomment-284533993
program.getTypeChecker();

return program;
};

Expand Down

0 comments on commit e065193

Please sign in to comment.