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.9 #13516

Closed
sosukesuzuki opened this issue Sep 24, 2022 · 7 comments
Closed

Support TypeScript 4.9 #13516

sosukesuzuki opened this issue Sep 24, 2022 · 7 comments
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
Milestone

Comments

@sosukesuzuki
Copy link
Member

sosukesuzuki commented Sep 24, 2022

TypeScript 4.9 Beta has been released!

We should support new syntax.

satisfies operator

const palette = {
    red: [255, 0, 0],
    green: "#00ff00",
    bleu: [0, 0, 255]
} satisfies Record<Colors, string | RGB>;

Anything else?

@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 Sep 24, 2022
@SaphireLattice
Copy link

SaphireLattice commented Sep 27, 2022

Seems to depend on @typescript-eslint/typescript-estree as seen here https://github.com/prettier/prettier/blob/main/src/language-js/parse/typescript.js#L39

Same relevant issue as eslint itself

@blixt
Copy link

blixt commented Nov 16, 2022

TypeScript 4.9 is now out but using satisfies with the latest released version of Prettier still errors:

["ERROR" - 1:58:59 PM] Error formatting document.
["ERROR" - 1:58:59 PM] ',' expected. (64:3)
  62 |     scrollSections: "on",
  63 |     textFill: "on",
> 64 | } satisfies Experiments
     |   ^
  65 |

Is there a workaround to this other than disabling Prettier for files using the keyword?

@kachkaev
Copy link
Member

kachkaev commented Nov 16, 2022

👋 @blixt! The support for satisfies will be added in Prettier 2.8, you can track the release process here: #13792.

The PR for new syntax is already merged: #13783

@sosukesuzuki
Copy link
Member Author

Prettier 2.8 that supports satisfies operator has been released! https://prettier.io/blog/2022/11/23/2.8.0.html

@sosukesuzuki
Copy link
Member Author

Auto-Accessor Syntax will be supported in the near future. Please wait.

@sosukesuzuki
Copy link
Member Author

2.8.1 has been released

@carpben
Copy link

carpben commented Jun 11, 2023

Seems like there is still an issue.
image
If we remove the casting, or cast with as const issue is resolved.
Can we open this?

@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 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 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

No branches or pull requests

5 participants