-
Notifications
You must be signed in to change notification settings - Fork 13
feat: support BigIntLiteral #35
feat: support BigIntLiteral #35
Conversation
This PR allowed me to catch the fact that a lot of ast-alignment tests are currently not being run: #36 |
That PR has now been merged, it might be that is surfaces some issues with updating the babel parser version, sorry for the confusion. I am hesitant to break away from our historically consistent approach of waiting until TypeScript versions become stable before supporting them. Currently Hopefully, therefore, for TypeScript 3.3 we will be able to automate everything and support TypeScript versions all through their prerelease phases, but for TypeScript 3.2, what I'd like to do is create a feature branch, and then once we are happy I will manually publish a release from it under a Sound good? |
I've created the branch: https://github.com/JamesHenry/typescript-estree/tree/ts-3.2 |
@JamesHenry, why not going other way around? making default branch as stable, and following latests rc/beta changes on separate branch and releasing them as *.*.*-beta.X |
I think we are describing the same thing? I am suggesting the base of this PR be changed to the new branch I just created, which will be the source of a new, non-stable distribution on npm. |
type: AST_NODE_TYPES.BigIntLiteral, | ||
raw, | ||
value | ||
}); |
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.
I'm still not sure what should this node look like. @babel/parser
parsed them as:
interface BigIntLiteral {
type: "BigIntLiteral";
value: string;
extra: {
raw: string;
rawValue: string;
}
}
but the alignment test rejected the extra
field and expected:
interface BigIntLiteral {
type: "BigIntLiteral";
value: string;
raw: string;
}
which is the current implementation.
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.
Hmm yeah seems there isn't quite a consensus yet: estree/estree#169
There hasn't been any update on that issue for a while...
I think the least likely of all is having that extra object involved in ESTree, so maybe we should just ignore the AST comparison for now?
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.
extra
is already ignored, I just want to make sure if it's fine to output the node that's different from babel's. 😅
typescript-estree/tests/ast-alignment/utils.ts
Lines 102 to 105 in 8e70375
{ | |
key: 'extra', | |
predicate: always | |
}, |
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.
Yeah I think it's fine, I think we just have to accept that as experimental things get added they may be subject to change.
We can always publish new major versions in future if we need to amend it
Ref: prettier/prettier#5545
typescript@3.2.0-rc
(bitInt
was added in TS 3.2)@babel/parser@7.1.6
(bigInt
was added in7.0.0-beta.48
)