Skip to content

Commit 7dff70e

Browse files
author
Even Alander
committed
Restore import and super
1 parent db46325 commit 7dff70e

File tree

5 files changed

+98
-1
lines changed

5 files changed

+98
-1
lines changed

docs/types.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,8 @@ Aliases: `Private`, `Property`
414414

415415
### classProperty
416416
```javascript
417-
t.classProperty(key)```
417+
t.classProperty(key)
418+
```
418419

419420
See also `t.isClassProperty(node, opts)` and `t.assertClassProperty(node, opts)`.
420421

@@ -1008,6 +1009,17 @@ Aliases: `Conditional`, `Statement`
10081009

10091010
---
10101011

1012+
### import
1013+
```javascript
1014+
t.import()
1015+
```
1016+
1017+
See also `t.isImport(node, opts)` and `t.assertImport(node, opts)`.
1018+
1019+
Aliases: `Expression`
1020+
1021+
---
1022+
10111023
### importDeclaration
10121024
```javascript
10131025
t.importDeclaration(specifiers, source)
@@ -1944,6 +1956,17 @@ Aliases: `Flow`, `FlowBaseAnnotation`, `FlowType`
19441956

19451957
---
19461958

1959+
### super
1960+
```javascript
1961+
t.super()
1962+
```
1963+
1964+
See also `t.isSuper(node, opts)` and `t.assertSuper(node, opts)`.
1965+
1966+
Aliases: `Expression`
1967+
1968+
---
1969+
19471970
### switchCase
19481971
```javascript
19491972
t.switchCase(test, consequent)

scripts/generate-docs-types.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,14 @@ const getArgumentsAndReturnType = def => {
206206
new RegExp(`^export function ${type}\\(`).test(l)
207207
);
208208

209+
if (findFunction.length === 0 && (type === "import" || type === "super")) {
210+
findFunction.push(
211+
`export function ${type}(): ${type
212+
.slice(0, 1)
213+
.toUpperCase()}${type.slice(1)};`
214+
);
215+
}
216+
209217
if (findFunction.length === 0) {
210218
continue;
211219
}

website/versioned_docs/version-7.0.0/types.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,17 @@ Aliases: `Conditional`, `Statement`
10101010

10111011
---
10121012

1013+
### import
1014+
```javascript
1015+
t.import()
1016+
```
1017+
1018+
See also `t.isImport(node, opts)` and `t.assertImport(node, opts)`.
1019+
1020+
Aliases: `Expression`
1021+
1022+
---
1023+
10131024
### importDeclaration
10141025
```javascript
10151026
t.importDeclaration(specifiers, source)
@@ -1946,6 +1957,17 @@ Aliases: `Flow`, `FlowBaseAnnotation`, `FlowType`
19461957

19471958
---
19481959

1960+
### super
1961+
```javascript
1962+
t.super()
1963+
```
1964+
1965+
See also `t.isSuper(node, opts)` and `t.assertSuper(node, opts)`.
1966+
1967+
Aliases: `Expression`
1968+
1969+
---
1970+
19491971
### switchCase
19501972
```javascript
19511973
t.switchCase(test, consequent)

website/versioned_docs/version-7.2.0/types.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,17 @@ Aliases: `Conditional`, `Statement`
10101010

10111011
---
10121012

1013+
### import
1014+
```javascript
1015+
t.import()
1016+
```
1017+
1018+
See also `t.isImport(node, opts)` and `t.assertImport(node, opts)`.
1019+
1020+
Aliases: `Expression`
1021+
1022+
---
1023+
10131024
### importDeclaration
10141025
```javascript
10151026
t.importDeclaration(specifiers, source)
@@ -1946,6 +1957,17 @@ Aliases: `Flow`, `FlowBaseAnnotation`, `FlowType`
19461957

19471958
---
19481959

1960+
### super
1961+
```javascript
1962+
t.super()
1963+
```
1964+
1965+
See also `t.isSuper(node, opts)` and `t.assertSuper(node, opts)`.
1966+
1967+
Aliases: `Expression`
1968+
1969+
---
1970+
19491971
### switchCase
19501972
```javascript
19511973
t.switchCase(test, consequent)

website/versioned_docs/version-7.4.0/types.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,17 @@ Aliases: `Conditional`, `Statement`
10101010

10111011
---
10121012

1013+
### import
1014+
```javascript
1015+
t.import()
1016+
```
1017+
1018+
See also `t.isImport(node, opts)` and `t.assertImport(node, opts)`.
1019+
1020+
Aliases: `Expression`
1021+
1022+
---
1023+
10131024
### importDeclaration
10141025
```javascript
10151026
t.importDeclaration(specifiers, source)
@@ -1946,6 +1957,17 @@ Aliases: `Flow`, `FlowBaseAnnotation`, `FlowType`
19461957

19471958
---
19481959

1960+
### super
1961+
```javascript
1962+
t.super()
1963+
```
1964+
1965+
See also `t.isSuper(node, opts)` and `t.assertSuper(node, opts)`.
1966+
1967+
Aliases: `Expression`
1968+
1969+
---
1970+
19491971
### switchCase
19501972
```javascript
19511973
t.switchCase(test, consequent)

0 commit comments

Comments
 (0)