Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit fb5e4c4

Browse files
authored
Breaking: Support TypeScript 2.7 (fixes #442,#426) (#447)
1 parent bd9c12f commit fb5e4c4

File tree

10 files changed

+487
-10
lines changed

10 files changed

+487
-10
lines changed

Diff for: .travis.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
language: node_js
22
sudo: false
33
node_js:
4-
- "4"
5-
- "5"
64
- "6"
75
- "7"
86
- "8"

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A parser that converts TypeScript source code into an [ESTree](https://github.co
88

99
We will always endeavor to support the latest stable version of TypeScript.
1010

11-
The version of TypeScript currently supported by this parser is `~2.6.1`. This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript.
11+
The version of TypeScript currently supported by this parser is `~2.7.1`. This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript.
1212

1313
If you use a non-supported version of TypeScript, the parser will log a warning to the console.
1414

Diff for: lib/ast-node-types.js

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ module.exports = {
141141
TSSymbolKeyword: "TSSymbolKeyword",
142142
TSTypeAnnotation: "TSTypeAnnotation",
143143
TSTypeLiteral: "TSTypeLiteral",
144+
TSTypeOperator: "TSTypeOperator",
144145
TSTypeParameter: "TSTypeParameter",
145146
TSTypeParameterDeclaration: "TSTypeParameterDeclaration",
146147
TSTypeParameterInstantiation: "TSTypeParameterInstantiation",

Diff for: lib/convert.js

+8
Original file line numberDiff line numberDiff line change
@@ -1573,6 +1573,14 @@ module.exports = function convert(config) {
15731573
});
15741574
break;
15751575

1576+
case SyntaxKind.TypeOperator:
1577+
Object.assign(result, {
1578+
type: AST_NODE_TYPES.TSTypeOperator,
1579+
operator: nodeUtils.getTextForTokenKind(node.operator),
1580+
typeAnnotation: convertChild(node.type)
1581+
});
1582+
break;
1583+
15761584
// Binary Operations
15771585

15781586
case SyntaxKind.BinaryExpression:

Diff for: lib/node-utils.js

+2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ TOKEN_TO_TEXT[SyntaxKind.BarEqualsToken] = "|=";
9797
TOKEN_TO_TEXT[SyntaxKind.CaretEqualsToken] = "^=";
9898
TOKEN_TO_TEXT[SyntaxKind.AtToken] = "@";
9999
TOKEN_TO_TEXT[SyntaxKind.InKeyword] = "in";
100+
TOKEN_TO_TEXT[SyntaxKind.UniqueKeyword] = "unique";
101+
TOKEN_TO_TEXT[SyntaxKind.KeyOfKeyword] = "keyof";
100102

101103
/**
102104
* Find the first matching child based on the given sourceFile and predicate function.

Diff for: package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
"license": "BSD-2-Clause",
2020
"devDependencies": {
2121
"babel-code-frame": "6.26.0",
22-
"babylon": "7.0.0-beta.34",
22+
"babylon": "7.0.0-beta.39",
2323
"dedent": "0.7.0",
24-
"eslint": "4.13.1",
24+
"eslint": "4.17.0",
2525
"eslint-config-eslint": "4.0.0",
26-
"eslint-plugin-node": "5.2.1",
26+
"eslint-plugin-node": "6.0.0",
2727
"eslint-release": "0.10.3",
2828
"glob": "7.1.2",
29-
"jest": "21.2.1",
29+
"jest": "22.2.1",
3030
"lodash.isplainobject": "4.0.6",
3131
"npm-license": "0.3.3",
32-
"shelljs": "0.7.8",
32+
"shelljs": "0.8.1",
3333
"shelljs-nodecli": "0.1.1",
34-
"typescript": "~2.6.1"
34+
"typescript": "~2.7.1"
3535
},
3636
"keywords": [
3737
"ast",
@@ -56,7 +56,7 @@
5656
},
5757
"dependencies": {
5858
"lodash.unescape": "4.0.1",
59-
"semver": "5.4.1"
59+
"semver": "5.5.0"
6060
},
6161
"peerDependencies": {
6262
"typescript": "*"

Diff for: tests/ast-alignment/fixtures-to-test.js

+2
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@ let fixturePatternConfigsToTest = [
399399
"export-type-class-declaration",
400400
"abstract-interface",
401401
"export-type-alias-declaration",
402+
"unique-symbol",
403+
"keyof-operator",
402404
/**
403405
* tsep bug - Program.body[0].expression.left.properties[0].value.right is currently showing up
404406
* as `ArrayPattern`, babylon, acorn and espree say it should be `ArrayExpression`
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type x = keyof foo;
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type A = unique symbol;

0 commit comments

Comments
 (0)