This repository was archived by the owner on Jan 19, 2019. It is now read-only.
Chore: Build out AST comparison tests and categorize issues #358
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ok... This has been a huge undertaking but I have made a lot of progress! 🙌
All of the last few PRs from me have come about because of my work on this branch.
The new
known-issues.js
file captures all of the digging I had to do when encountering AST differences on JavaScript constructs between the two parsers. In many cases, I also researched how the other major parsers (espree, acorn etc) would interpret the code and noted the behaviour in the file. It's often frustratingly inconsistent 😅Other Important points:
typescript-eslint-parser
andbabylon
, or if it is not possible, having their issues clearly categorized withinknown-issues.js
.fixtures/typescript/
- this is obviously the key directory to get sorted in terms oftypescript-eslint-parser
+babylon-typescript-plugin
, but it makes sense to leave any work in that area out of this PR, as there will likely be many breaking changes to come.parse()
function used in the comparison tests now always returns a consistent object (it will no longer throw on parse error), because there are many cases in which we expect both parsers to error based on the given source and we need to compare their erroring behaviour.typescript-eslint-parser
) have been centralized so that it can be shared across both unit and AST comparison testingWe now have ~350 comparison tests passing:

@DanielRosenwasser @Andy-MS after this PR goes in we should be completely freed up to dig into TS-specific AST differences! 🚀