This repository has been archived by the owner on Jan 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Babel vs TSE: TrueKeyword and FalseKeyword #58
Comments
armano2
changed the title
TrueKeyword and FalseKeyword
Babel vs TSE: TrueKeyword and FalseKeyword
Dec 21, 2018
Babel expect when used as value: const test = true; {
"type": "Program",
"sourceType": "script",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "test"
},
"init": {
"type": "Literal",
"value": true,
"raw": "true"
}
}
],
"kind": "const"
}
]
} when used as type: type Foo = false {
"type": "Program",
"sourceType": "script",
"body": [
{
"type": "TSTypeAliasDeclaration",
"id": {
"type": "Identifier",
"name": "Foo"
},
"typeAnnotation": {
"type": "TSLiteralType",
"literal": {
"type": "BooleanLiteral",
"value": false
}
}
}
]
} but we are always outputting it as |
Hmm yeah, awkward one. IIRC BooleanLiteral is what babel does as standard and then the ESTree plugin converts it to Literal |
ok i will investigate that, and most likely report error there |
Thanks! I'll leave this issue open for now as a reminder |
We're not explicitly tracking any of the other babel issues on this repo so I'm going to close this for consistency with that |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently we are parsing
TrueKeyword
andFalseKeyword
astype='Literal'
when in type, but babel parses them asBooleanLiteral
,i'm unsure what we should do with this...
The text was updated successfully, but these errors were encountered: