-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[TypeScript 3.7] add support for optional chaining #6595
Comments
Thanks for creating the issue. It is still in dev, we have not support it yet as mentioned in #6574. |
@sosukesuzuki but you mean |
@lppedd I meant |
@sosukesuzuki thanks! Here we are already using TS 3.7 |
I think we need update ts parser |
@evilebottnawi I think so too. But, I'm worried that we can't update |
Could we use the babel parser instead? It already has support for Typescript when using the typescript preset |
@evilebottnawi so that means after merging that PR, potentially I could build Prettier and use the Babel parser with 3.7 (and thus keep formatting)? |
@lppedd should be, but we still need add tests to avoid regression |
@evilebottnawi sure. It would be only a temporary solution to keep using Prettier. |
Can |
@fisker sometimes ts command do big changes on alpha or beta, better wait stable release |
@evilebottnawi you're right, I'm going to test on 3.7.0-beta to prepare for 3.7 stable release |
3.7.0-beta can parse this now, but not printing it right, maybe related to #6569 |
So, as I need to format TS 3.7, I forked this repository and merged on Example configuration
Remember to alias the command |
You should not publish a npm package cause you cant unpublish it after 24 hours , should install from your repo |
I do: And edit my
Prettier outputs in VS Code: Update: Reloading the VS Code window fixes this. |
@jwulf yes, that happen because you're still using the standard Prettier. |
FYI, we just landed and released typescript-eslint/typescript-eslint#1045 which adds support for optional chaining, nullish coalescing and assertion functions in |
@bradzacher Unfortunately, Prettier has troubles with updating to the new version of BTW, didn't you miss this 3.7 syntax addition? |
hmmm, I did miss it. It wasn't listed in the beta release post. We still have full compat with node 6, we just don't explicitly test against it any more. We only dropped explicit support to keep sync with ESLint themselves, and because it was EOL in April. AFAIK there weren't any breaking changes between node 6 -> 8 that should effect our codebase / cause us to lose implicit support. |
It would be wonderful. |
@bradzacher |
In the process of exploring the removal of that dep. |
@lydell Is there a stated plan for releasing a version with this change? |
@MLoughry Yes! We’ve just finished all blocking items for the 1.19 milestone. |
@lydell typescript 3.7 just came out, please run the release |
I was going to a couple of hours ago but ran into problems. I'll try again tomorrow. |
👏 👏 👏 |
@lydell Thank your team for looking forward to this feature. typescript 3.7 is faster. |
Please prettier team, i'm too excited to use the new features |
Maintainers are definitely trying their best to cut a release as soon as possible. Postponing is still better than rushing towards a pile of potential issues. We all appreciate the hard work put into this project and wish the best to everyone involved! |
For the ones that cannot wait for the new release, you can just install prettier from the master branch |
P.S: Thumbs-down voters: come on folks, don't make somebody feel shame (I would feel that way) because they are so happy to have such fantastic feature, do you realize how exciting this feature is? They want to share with you 🤷🏻♂️ why not?! Be friendly and welcoming; it takes less energy and will make you feel better. I get it, you get useless notifications (like mine), unsubscribe if that bothers you that much, the ticket is closed anyway. ☮️ |
The goal of issues is to discuss the actual issue itself and/or stuff that has to be done around the issue, instead of creating a place to distract the maintainers from actually fixing the issue. @yordis |
@vernondegoede I agree with you, that is why you close the threads 😉 So you avoid toxic environments where some people want to focus on pragmatism but at the cost of people that don't understand that 🤷🏻♂️ I am just trying to help you. Hard to disagree with your thoughts since I am more alike to you, but I refuse to justify toxic behaviors for such pity thing. Close the thread as soon as things are resolved, the problem is solved. |
Not to beat a dead horse further but this is the ultimate irony @yordis .... facebook/create-react-app#7438 (comment) With that said thanks for the workaround @JCMais! |
@BrandonKowalski you are right thinking that way, but you are wrong thinking that people don't change and calling this irony, that is a simple conclusion. Because of those exact words, I figured out what the solution for this issue is 😉 I figured out that being toxic helps nobody included the maintainers, so now I more proactive now. Close threads if you want to stop these things from happening, otherwise stop being pitiful and toxic. |
Locking for avoid toxicity, release will be tomorrow (Friday), big thanks for all who help us |
Environments:
Steps to reproduce:
I was able to reproduce in the playground when using the typescript parser, which I guess it's the parser that ends up being used by prettier in typescript files? In my case its happening for both
.ts
and.tsx
file extensions.https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBDAdAIwPzrCAGhAgAcYBLaAZ2VFQCd6IB3ABQYRpVQDcJyAJoRCZ6qMAGs4MAMolx5KAHNkMegFc4RABYwAtgBsA6tvLwq8sHBmcz5HmYCeycFRpFFVOPRisxSvVRkADNUAy8iACsqAA8AITFJaRlUPTgAGUU4ELCIkGiYmUUlAzgARXUIeBzwrRB5ei96FxhHEjgqMHpyMmESbtgjQRhtZAAOAAYifogvIzESF36O7x5sogBHSvg-Ui40KgBaKDg4ATPhejgt8iu-VACgpFDaoi89clUNOqpi0oqqtlnrk6jBUJghgIRsgAExENSocgGYoAYQgekCLig0HWIHUXgAKuCuC8vABfMlAA
Expected behavior: does not throw "Expression expected" syntax error when using optional chaining in typescript files
Actual behavior: throw "Expression expected" syntax error when using optional chaining in typescript files
The text was updated successfully, but these errors were encountered: