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

Support TypeScript 4.1 #9234

Closed
sosukesuzuki opened this issue Sep 20, 2020 · 7 comments · Fixed by #9725
Closed

Support TypeScript 4.1 #9234

sosukesuzuki opened this issue Sep 20, 2020 · 7 comments · Fixed by #9725
Assignees
Labels
lang:typescript Issues affecting TypeScript-specific constructs (not general JS issues) locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency type:enhancement A potential new feature to be added, or an improvement to how we print something

Comments

@sosukesuzuki
Copy link
Member

sosukesuzuki commented Sep 20, 2020

TypeScript 4.1 beta has been released!

We should support new syntax:

Template Literal Types

https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types

type Greeting = `hello ${World}`;

Key Remapping in Mapped Types

https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#key-remapping-mapped-types

type MappedTypeWithNewKeys<T> = {
    [K in keyof T as NewKeyType]: T[K]
}
@sosukesuzuki sosukesuzuki added type:enhancement A potential new feature to be added, or an improvement to how we print something scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency lang:typescript Issues affecting TypeScript-specific constructs (not general JS issues) labels Sep 20, 2020
@sosukesuzuki sosukesuzuki pinned this issue Sep 20, 2020
@josephfrazier josephfrazier unpinned this issue Oct 14, 2020
@josephfrazier josephfrazier pinned this issue Oct 14, 2020
@sosukesuzuki
Copy link
Member Author

Babel 7.12 that supports TypeScript 4.1 has been released!. So we can support TypeScript 4.1 via babel-ts parser.

@schickling
Copy link

Thanks a lot for adding support for TS 4.1. Is the functionality merged with #9473 already released/published somewhere to be tested?

@sosukesuzuki
Copy link
Member Author

@schickling You can try to use TS 4.1 support via Babel with Installing from GitHub. See https://prettier.io/versions.html.(Need to run npm install prettier/prettier. )
Also need to update your configuration file to use babel-ts parser. See https://prettier.io/docs/en/options.html#parser and https://prettier.io/docs/en/configuration.html#configuration-overrides.

@aleclofabbro
Copy link

Thanks for the effort on this issue !
2 Qs:
how can I get notified when a stable version will be released ?
Are you aware of a way to enable vscode's prettier extension with TS4.1 support (type templates at least) ?

@wdoug
Copy link

wdoug commented Nov 20, 2020

I'm just curious to follow up on that last question. Now that TypeScript 4.1 is officially released, I saw you @sosukesuzuki had mentioned opening a separate PR for releasing this. Any idea when that might be ready or if there is anything we could do to help get this pushed to npm?

@sosukesuzuki
Copy link
Member Author

@wdoug Thank you! I've created the PR that update to TypeScript 4.1. We can work for releasing after merge #9725.

@sosukesuzuki sosukesuzuki unpinned this issue Nov 20, 2020
@sosukesuzuki

This comment has been minimized.

@github-actions github-actions bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Feb 19, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang:typescript Issues affecting TypeScript-specific constructs (not general JS issues) locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency type:enhancement A potential new feature to be added, or an improvement to how we print something
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants