prettier
prettier copied to clipboard
Support TypeScript 5.2
TypeScript 5.2 beta has been released.
- https://github.com/typescript-eslint/typescript-eslint/issues/7155
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 Will TypeScript 5.2 be supported in prettier v3.x or v2.x?
Maybe 3.x
Is there any special treatment that Prettier
should provide to Typescript 5.2
?
What is the current way Prettier
is handling the former code?
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");
Parser 'babel-ts'
may already support this syntax.
I'm getting a prettier error because of using
keyword with eslint plugin and typescript
TypeScript 5.2 stable is released.
Anyone working on formatting using
declarations in prettier?
I'll work on this when https://github.com/typescript-eslint/typescript-eslint/pull/7479 is released.
The newly released [email protected] now supports TypeScript 5.2