-
Notifications
You must be signed in to change notification settings - Fork 13
Conversation
Great addition, @g-plane! I had to prioritize getting in the big PR from Ben, would you mind updating this? Thanks! |
What does it need to be updated? |
@g-plane It looks like there are merge conflicts now. |
Oh, I'm using mobile phone now so I cannot see the conflicts notice. Sorry! |
You should try GitHawk! Sent with GitHawk |
@JamesHenry Problems are fixed. |
src/parser.ts
Outdated
(currentProgram: ts.Program) => { | ||
const ast = currentProgram.getSourceFile(options.filePath); | ||
const ast = currentProgram.getSourceFile( | ||
options.filePath || (options.jsx ? 'estree.ts' : 'estree.tsx') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This filename logic is now separately defined 3 times within this file, can we promote it to be defined once at a higher level?
Other than that the PR LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
Thanks! |
🎉 This PR is included in version 5.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Previously, type of the return value of
parse
function isany
. This PR makes it strongly typed.Additions:
options
can beundefined
now and all the properties ofoptions
can beundefined
. That is, all the code below are valid:tokens
option like this:The
tokens
property will not exist in the variableast
.Instead, if we enable the
tokens
option:We can find that an additional
tokens
property is existed on theast
.