Skip to content

Commit 75dc9ab

Browse files
committed
Update babel parser
1 parent 3384c08 commit 75dc9ab

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

__tests__/lib/flow_doctrine.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ test('flowDoctrine', function() {
304304
expect(types).toEqual([
305305
'IntersectionTypeAnnotation',
306306
'EmptyTypeAnnotation',
307+
'NumericLiteralTypeAnnotation',
307308
'TypeofTypeAnnotation'
308309
]);
309310
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"documentation": "./bin/documentation.js"
88
},
99
"dependencies": {
10+
"@babel/parser": "^7.0.0-beta.55",
1011
"ansi-html": "^0.0.7",
1112
"babel-core": "^6.26.0",
1213
"babel-generator": "^6.26.0",
@@ -18,7 +19,6 @@
1819
"babel-traverse": "^6.26.0",
1920
"babel-types": "^6.26.0",
2021
"babelify": "^8.0.0",
21-
"babylon": "^6.18.0",
2222
"chalk": "^2.3.0",
2323
"chokidar": "^2.0.0",
2424
"concat-stream": "^1.6.0",

src/flow_doctrine.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function flowDoctrine(type: Object): DoctrineType {
142142
type: 'BooleanLiteralType',
143143
value: type.value
144144
};
145-
case 'NumericLiteralTypeAnnotation':
145+
case 'NumberLiteralTypeAnnotation':
146146
return {
147147
type: 'NumericLiteralType',
148148
value: type.value

src/parsers/parse_to_ast.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/* @flow */
22

3-
const babylon = require('babylon');
3+
const babelParser = require('@babel/parser');
44

55
const opts = {
66
allowImportExportEverywhere: true,
77
sourceType: 'module',
88
plugins: [
99
'asyncGenerators',
10+
'exportDefaultFrom',
1011
'classConstructorCall',
1112
'classProperties',
1213
'decorators',
@@ -36,5 +37,5 @@ export function commentToFlow(source: string) {
3637
}
3738

3839
export function parseToAst(source: string) {
39-
return babylon.parse(commentToFlow(source), opts);
40+
return babelParser.parse(commentToFlow(source), opts);
4041
}

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
dependencies:
3333
"@babel/types" "7.0.0-beta.36"
3434

35+
"@babel/parser@^7.0.0-beta.55":
36+
version "7.0.0-beta.55"
37+
resolved "https://registry.yarnpkg.com/@babel%2fparser/-/parser-7.0.0-beta.55.tgz#0a527efc148c6c8cd85d5ffddacad817a2daeeb2"
38+
3539
3640
version "7.0.0-beta.36"
3741
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.36.tgz#02e903de5d68bd7899bce3c5b5447e59529abb00"

0 commit comments

Comments
 (0)