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.2 #10048

Closed
sosukesuzuki opened this issue Jan 13, 2021 · 6 comments · Fixed by #10466 or #10589
Closed

Support TypeScript 4.2 #10048

sosukesuzuki opened this issue Jan 13, 2021 · 6 comments · Fixed by #10466 or #10589
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 Jan 13, 2021

TypeScript 4.2 beta has been announced.

We should consider to support new syntax:

Leading/Middle Rest Elements in Tuple Types

Prettier already can format leading/middle rest elements. We should add more tests.

let bar: [boolean, ...string[], boolean];
let StealersWheel: [...Clown[], "me", ...Joker[]];

abstract constructor signatures

let Ctor: abstract new () => HasArea = Shape;

namespaced JSX elements and attributes

const foo = <n:a n:v />;

Anything else?

@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 Jan 13, 2021
@sosukesuzuki sosukesuzuki pinned this issue Jan 13, 2021
@remcohaszing
Copy link

I doubt this requires any changes in Prettier, but TypeScript 4.2 also supports namespaced JSX elements and attributes.

@Gerrit0
Copy link

Gerrit0 commented Mar 4, 2021

TypeScript 4.2 is out! Is there anything I can do to make support happen sooner? Abstract constructor types are the one thing that's getting in my way.

@leops
Copy link

leops commented Mar 4, 2021

I think Prettier uses @typescript-eslint/typescript-estree to parse TypeScript, and support of TypeScript 4.2 was added in version 4.16.0 of that library so unless some special handling of the new nodes is required in Prettier, the only thing needed to support the new syntax would be upgrading the typescript-eslint dependency ?

@thorn0
Copy link
Member

thorn0 commented Mar 16, 2021

Turns out this issue was closed too early. See typescript-eslint/typescript-eslint#3183

@dora-gt
Copy link

dora-gt commented Apr 15, 2021

Has this been shipped already?
I use prettier 2.2.1 and it warns abstract constructor like the following.

image

@sosukesuzuki
Copy link
Member Author

No, TypeScript 4.2 supports have not been released yet.

@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 Jul 15, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 15, 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
6 participants