Skip to content

Commit

Permalink
Restore import and super
Browse files Browse the repository at this point in the history
  • Loading branch information
Even Alander committed Aug 11, 2019
1 parent db46325 commit 7dff70e
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 1 deletion.
25 changes: 24 additions & 1 deletion docs/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ Aliases: `Private`, `Property`

### classProperty
```javascript
t.classProperty(key)```
t.classProperty(key)
```

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

Expand Down Expand Up @@ -1008,6 +1009,17 @@ Aliases: `Conditional`, `Statement`

---

### import
```javascript
t.import()
```

See also `t.isImport(node, opts)` and `t.assertImport(node, opts)`.

Aliases: `Expression`

---

### importDeclaration
```javascript
t.importDeclaration(specifiers, source)
Expand Down Expand Up @@ -1944,6 +1956,17 @@ Aliases: `Flow`, `FlowBaseAnnotation`, `FlowType`

---

### super
```javascript
t.super()
```

See also `t.isSuper(node, opts)` and `t.assertSuper(node, opts)`.

Aliases: `Expression`

---

### switchCase
```javascript
t.switchCase(test, consequent)
Expand Down
8 changes: 8 additions & 0 deletions scripts/generate-docs-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,14 @@ const getArgumentsAndReturnType = def => {
new RegExp(`^export function ${type}\\(`).test(l)
);

if (findFunction.length === 0 && (type === "import" || type === "super")) {
findFunction.push(
`export function ${type}(): ${type
.slice(0, 1)
.toUpperCase()}${type.slice(1)};`
);
}

if (findFunction.length === 0) {
continue;
}
Expand Down
22 changes: 22 additions & 0 deletions website/versioned_docs/version-7.0.0/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,17 @@ Aliases: `Conditional`, `Statement`

---

### import
```javascript
t.import()
```

See also `t.isImport(node, opts)` and `t.assertImport(node, opts)`.

Aliases: `Expression`

---

### importDeclaration
```javascript
t.importDeclaration(specifiers, source)
Expand Down Expand Up @@ -1946,6 +1957,17 @@ Aliases: `Flow`, `FlowBaseAnnotation`, `FlowType`

---

### super
```javascript
t.super()
```

See also `t.isSuper(node, opts)` and `t.assertSuper(node, opts)`.

Aliases: `Expression`

---

### switchCase
```javascript
t.switchCase(test, consequent)
Expand Down
22 changes: 22 additions & 0 deletions website/versioned_docs/version-7.2.0/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,17 @@ Aliases: `Conditional`, `Statement`

---

### import
```javascript
t.import()
```

See also `t.isImport(node, opts)` and `t.assertImport(node, opts)`.

Aliases: `Expression`

---

### importDeclaration
```javascript
t.importDeclaration(specifiers, source)
Expand Down Expand Up @@ -1946,6 +1957,17 @@ Aliases: `Flow`, `FlowBaseAnnotation`, `FlowType`

---

### super
```javascript
t.super()
```

See also `t.isSuper(node, opts)` and `t.assertSuper(node, opts)`.

Aliases: `Expression`

---

### switchCase
```javascript
t.switchCase(test, consequent)
Expand Down
22 changes: 22 additions & 0 deletions website/versioned_docs/version-7.4.0/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,17 @@ Aliases: `Conditional`, `Statement`

---

### import
```javascript
t.import()
```

See also `t.isImport(node, opts)` and `t.assertImport(node, opts)`.

Aliases: `Expression`

---

### importDeclaration
```javascript
t.importDeclaration(specifiers, source)
Expand Down Expand Up @@ -1946,6 +1957,17 @@ Aliases: `Flow`, `FlowBaseAnnotation`, `FlowType`

---

### super
```javascript
t.super()
```

See also `t.isSuper(node, opts)` and `t.assertSuper(node, opts)`.

Aliases: `Expression`

---

### switchCase
```javascript
t.switchCase(test, consequent)
Expand Down

0 comments on commit 7dff70e

Please sign in to comment.