Add support for flow's export type * from (#617)
This commit is contained in:
@@ -110,7 +110,8 @@
|
||||
"raw": "\"bar\""
|
||||
},
|
||||
"value": "bar"
|
||||
}
|
||||
},
|
||||
"exportKind": "value"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
1
test/fixtures/flow/declare-export/export-type-star-from/actual.js
vendored
Normal file
1
test/fixtures/flow/declare-export/export-type-star-from/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
declare module "foo" { declare export type * from "bar"; }
|
||||
123
test/fixtures/flow/declare-export/export-type-star-from/expected.json
vendored
Normal file
123
test/fixtures/flow/declare-export/export-type-star-from/expected.json
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 58,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 58
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 58,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 58
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"body": [
|
||||
{
|
||||
"type": "DeclareModule",
|
||||
"start": 0,
|
||||
"end": 58,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 58
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "StringLiteral",
|
||||
"start": 15,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": "foo",
|
||||
"raw": "\"foo\""
|
||||
},
|
||||
"value": "foo"
|
||||
},
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 21,
|
||||
"end": 58,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 58
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "DeclareExportAllDeclaration",
|
||||
"start": 23,
|
||||
"end": 56,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 56
|
||||
}
|
||||
},
|
||||
"exportKind": "type",
|
||||
"source": {
|
||||
"type": "StringLiteral",
|
||||
"start": 50,
|
||||
"end": 55,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 50
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 55
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": "bar",
|
||||
"raw": "\"bar\""
|
||||
},
|
||||
"value": "bar"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"kind": "ES"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
1
test/fixtures/flow/type-exports/star-as-from/actual.js
vendored
Normal file
1
test/fixtures/flow/type-exports/star-as-from/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export type * as fooTypes from "foo";
|
||||
5
test/fixtures/flow/type-exports/star-as-from/options.json
vendored
Normal file
5
test/fixtures/flow/type-exports/star-as-from/options.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"plugins": ["flow","exportExtensions"],
|
||||
"throws": "Unexpected token (1:14)"
|
||||
}
|
||||
1
test/fixtures/flow/type-exports/star-from/actual.js
vendored
Normal file
1
test/fixtures/flow/type-exports/star-from/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export type * from "foo";
|
||||
70
test/fixtures/flow/type-exports/star-from/expected.json
vendored
Normal file
70
test/fixtures/flow/type-exports/star-from/expected.json
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportAllDeclaration",
|
||||
"start": 0,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
}
|
||||
},
|
||||
"exportKind": "type",
|
||||
"source": {
|
||||
"type": "StringLiteral",
|
||||
"start": 19,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": "foo",
|
||||
"raw": "\"foo\""
|
||||
},
|
||||
"value": "foo"
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user