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 5.2 #15004

Closed
sosukesuzuki opened this issue Jul 2, 2023 · 9 comments · Fixed by #15321
Closed

Support TypeScript 5.2 #15004

sosukesuzuki opened this issue Jul 2, 2023 · 9 comments · Fixed by #15321
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. type:enhancement A potential new feature to be added, or an improvement to how we print something

Comments

@sosukesuzuki
Copy link
Member

sosukesuzuki commented Jul 2, 2023

TypeScript 5.2 beta has been released.

using / await using

function func() {
    using a = loggy("a");
    using b = loggy("b");
    {
        using c = loggy("c");
        using d = loggy("d");
    }
    using e = loggy("e");
    return;

    // Unreachable.
    // Never created, never disposed.
    using f = loggy("f");
}
@sosukesuzuki sosukesuzuki added type:enhancement A potential new feature to be added, or an improvement to how we print something lang:typescript Issues affecting TypeScript-specific constructs (not general JS issues) labels Jul 2, 2023
@xiaoxiangmoe
Copy link
Contributor

@sosukesuzuki Will TypeScript 5.2 be supported in prettier v3.x or v2.x?

@sosukesuzuki
Copy link
Member Author

Maybe 3.x

@MatanelGordon
Copy link
Contributor

Is there any special treatment that Prettier should provide to Typescript 5.2?

What is the current way Prettier is handling the former code?

@michaelfaith
Copy link

Just tested with the code from the OP, and get the following error. Doesn't seem like it'll even run against it.

src/test.ts
[error] src/test.ts: SyntaxError: Unexpected keyword or identifier. (2:3)
[error]   1 | function func() {
[error] > 2 |   using a = loggy("a");
[error]     |   ^
[error]   3 |   using b = loggy("b");
[error]   4 |   {
[error]   5 |       using c = loggy("c");

@fisker
Copy link
Member

fisker commented Jul 11, 2023

Parser 'babel-ts' may already support this syntax.

@SPAHI4
Copy link

SPAHI4 commented Jul 19, 2023

I'm getting a prettier error because of using keyword with eslint plugin and typescript

@trivikr
Copy link

trivikr commented Aug 25, 2023

TypeScript 5.2 stable is released.

Anyone working on formatting using declarations in prettier?

@sosukesuzuki
Copy link
Member Author

sosukesuzuki commented Aug 25, 2023

I'll work on this when typescript-eslint/typescript-eslint#7479 is released.

@sosukesuzuki sosukesuzuki pinned this issue Aug 25, 2023
@trivikr
Copy link

trivikr commented Aug 28, 2023

The newly released typescript-eslint@6.5.0 now supports TypeScript 5.2

@sosukesuzuki sosukesuzuki unpinned this issue Sep 2, 2023
@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 Nov 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 28, 2023
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. 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.

7 participants