Skip to content

Commit d0ec029

Browse files
jquensetmcw
authored andcommitted
feat: upgrade babel dependencies
- Fix private method parsing/traversal - Add TS bigint primitive - Add flow symbol primitive
1 parent 2701618 commit d0ec029

File tree

10 files changed

+1678
-1052
lines changed

10 files changed

+1678
-1052
lines changed

__tests__/__snapshots__/test.js.snap

+641-179
Large diffs are not rendered by default.

__tests__/fixture/es6.input.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ function destructure({
1111
/**
1212
* Similar, but with an array
1313
* @example
14-
* destructure([0, 1, 2, 3])
14+
* destructure2([0, 1, 2, 3])
1515
*/
16-
function destructure([, a, b, c]) {}
16+
function destructure2([, a, b, c]) {}
1717

1818
/**
1919
* This function returns the number one.

__tests__/fixture/html/nested.input.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function bar() {
112112
* Rest property function
113113
* @returns {undefined} nothing
114114
*/
115-
function bar(...toys: Number) {
115+
function bar2(...toys: Number) {
116116
return undefined;
117117
}
118118

@@ -123,7 +123,7 @@ function bar(...toys: Number) {
123123
*
124124
* @returns {undefined} nothing
125125
*/
126-
function bar() {
126+
function bar3() {
127127
return undefined;
128128
}
129129

__tests__/lib/flow_doctrine.js

+1
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ test('flowDoctrine', function() {
311311
'InterfaceTypeAnnotation',
312312
'IntersectionTypeAnnotation',
313313
'EmptyTypeAnnotation',
314+
'SymbolTypeAnnotation',
314315
'TypeofTypeAnnotation'
315316
]);
316317
});

__tests__/lib/ts_doctrine.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ test('tsDoctrine', function() {
392392
});
393393

394394
expect(types).toEqual([
395+
'TSBigIntKeyword',
395396
'TSTypePredicate',
396397
'TSTypeQuery',
397398
'TSOptionalType', // handled - not top-level.
@@ -402,6 +403,7 @@ test('tsDoctrine', function() {
402403
'TSTypeOperator',
403404
'TSIndexedAccessType',
404405
'TSMappedType',
405-
'TSExpressionWithTypeArguments'
406+
'TSExpressionWithTypeArguments',
407+
'TSImportType'
406408
]);
407409
});

package.json

+26-25
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,32 @@
88
"documentation": "./bin/documentation.js"
99
},
1010
"dependencies": {
11-
"@babel/core": "^7.1.2",
12-
"@babel/generator": "^7.1.3",
13-
"@babel/parser": "7.1.3",
14-
"@babel/plugin-proposal-class-properties": "^7.1.0",
15-
"@babel/plugin-proposal-decorators": "^7.1.2",
16-
"@babel/plugin-proposal-do-expressions": "^7.0.0",
17-
"@babel/plugin-proposal-export-default-from": "^7.0.0",
18-
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
19-
"@babel/plugin-proposal-function-bind": "^7.0.0",
20-
"@babel/plugin-proposal-function-sent": "^7.1.0",
21-
"@babel/plugin-proposal-json-strings": "^7.0.0",
22-
"@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
23-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
24-
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
25-
"@babel/plugin-proposal-optional-chaining": "^7.0.0",
26-
"@babel/plugin-proposal-pipeline-operator": "^7.0.0",
27-
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
28-
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
29-
"@babel/plugin-syntax-import-meta": "^7.0.0",
30-
"@babel/preset-env": "^7.1.0",
31-
"@babel/preset-flow": "^7.0.0",
32-
"@babel/preset-react": "^7.0.0",
33-
"@babel/preset-stage-0": "^7.0.0",
34-
"@babel/traverse": "^7.1.4",
35-
"@babel/types": "^7.1.3",
11+
"@babel/core": "^7.9.0",
12+
"@babel/generator": "^7.9.4",
13+
"@babel/parser": "7.9.4",
14+
"@babel/plugin-proposal-class-properties": "^7.8.3",
15+
"@babel/plugin-proposal-decorators": "^7.8.3",
16+
"@babel/plugin-proposal-do-expressions": "^7.8.3",
17+
"@babel/plugin-proposal-export-default-from": "^7.8.3",
18+
"@babel/plugin-proposal-export-namespace-from": "^7.8.3",
19+
"@babel/plugin-proposal-function-bind": "^7.8.3",
20+
"@babel/plugin-proposal-function-sent": "^7.8.3",
21+
"@babel/plugin-proposal-json-strings": "^7.8.3",
22+
"@babel/plugin-proposal-logical-assignment-operators": "^7.8.3",
23+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
24+
"@babel/plugin-proposal-numeric-separator": "^7.8.3",
25+
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
26+
"@babel/plugin-proposal-pipeline-operator": "^7.8.3",
27+
"@babel/plugin-proposal-private-methods": "^7.8.3",
28+
"@babel/plugin-proposal-throw-expressions": "^7.8.3",
29+
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
30+
"@babel/plugin-syntax-import-meta": "^7.8.3",
31+
"@babel/preset-env": "^7.9.0",
32+
"@babel/preset-flow": "^7.9.0",
33+
"@babel/preset-react": "^7.9.4",
34+
"@babel/preset-stage-0": "^7.8.3",
35+
"@babel/traverse": "^7.9.0",
36+
"@babel/types": "^7.9.0",
3637
"ansi-html": "^0.0.7",
3738
"babelify": "^10.0.0",
3839
"chalk": "^2.3.0",

src/flow_doctrine.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ const generate = require('@babel/generator').default;
33
const namedTypes = {
44
NumberTypeAnnotation: 'number',
55
BooleanTypeAnnotation: 'boolean',
6-
StringTypeAnnotation: 'string'
6+
StringTypeAnnotation: 'string',
7+
SymbolTypeAnnotation: 'symbol'
78
};
89

910
const oneToOne = {

src/input/dependency.js

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const STANDARD_BABEL_CONFIG = {
3232
'@babel/plugin-syntax-dynamic-import',
3333
'@babel/plugin-syntax-import-meta',
3434
['@babel/plugin-proposal-class-properties', { loose: false }],
35+
'@babel/plugin-proposal-private-methods',
3536
'@babel/plugin-proposal-json-strings'
3637
]
3738
};

src/ts_doctrine.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const generate = require('@babel/generator').default;
22

33
const namedTypes = {
4+
TSBigIntKeyword: 'bigint',
45
TSNumberKeyword: 'number',
56
TSBooleanKeyword: 'boolean',
67
TSStringKeyword: 'string',

0 commit comments

Comments
 (0)