Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial support for TypeScript 3.8 (private fields, import/export type modifier) #7631

Merged
merged 6 commits into from Mar 11, 2020

Conversation

thorn0
Copy link
Member

@thorn0 thorn0 commented Feb 19, 2020

@thorn0 thorn0 changed the base branch from master to next February 19, 2020 12:05
package.json Outdated Show resolved Hide resolved
Copy link
Member

@sosukesuzuki sosukesuzuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeScript 3.8 supports top-level await, so this pr will fix #6608

@BPScott
Copy link
Member

BPScott commented Mar 9, 2020

typescript-estree v2.23.0 has been released which contains support for the import/export type format.

The other parts of typescript-eslint/typescript-eslint#1436 have not yet been released as their AST spec has not yet been finalized. It seems like these may take a while to get consensus on so I'd be very tempted to not wait for them.

@thorn0 thorn0 force-pushed the typescript-3.8 branch 2 times, most recently from 63ba70d to 869b396 Compare March 11, 2020 12:53
@thorn0 thorn0 changed the title Support TypeScript 3.8 Partial support for TypeScript 3.8 (private fields, import/export type modifier) Mar 11, 2020
@thorn0 thorn0 mentioned this pull request Mar 11, 2020
@thorn0 thorn0 marked this pull request as ready for review March 11, 2020 12:59
@alexander-akait alexander-akait merged commit 318bf2c into prettier:next Mar 11, 2020
@sosukesuzuki sosukesuzuki added this to the 2.0 milestone Mar 11, 2020
| ------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ----------------- |
| [Type-Only Imports and Exports](https://devblogs.microsoft.com/typescript/announcing-typescript-3-8/#type-only-imports-exports) | ✔️ | ❌ |
| [ECMAScript Private Fields](https://devblogs.microsoft.com/typescript/announcing-typescript-3-8/#ecmascript-private-fields) | ✔️ | ✔️ |
| [`export * as ns`](https://devblogs.microsoft.com/typescript/announcing-typescript-3-8/#export-star-as-namespace-syntax) | ❌ | ❌ |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export * as ns seems to be supported with babel-ts.
Playground

parser=babel-ts

Input:

export * as foo from './foo';

Output

export * as foo from "./foo";

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. Overlooked this somehow. I'll fix the changelog.

export type { A as B };
export type { B as C } from "./a";
export type { foo } from "bar";
export type * from "bar";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thorn0 Is this test needed? TS Playground says "Only named exports may use 'export type'.".
https://www.typescriptlang.org/play/?ssl=1&ssc=1&pln=2&pc=1#code/KYDwDg9gTgLgBDAnmYcBUcBmUIFs4BEARgIZQEDcAUEA

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this test. Babel 7.9.0 can't parse it.

@thorn0 thorn0 deleted the typescript-3.8 branch July 8, 2020 22:31
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support TypeScript 3.8
7 participants