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

Playground: code formmating broken with TS3.4+ readonly notation #32

Closed
jcalz opened this issue Jul 15, 2019 · 4 comments
Closed

Playground: code formmating broken with TS3.4+ readonly notation #32

jcalz opened this issue Jul 15, 2019 · 4 comments

Comments

@jcalz
Copy link

jcalz commented Jul 15, 2019

Code:
Looks like the readonly modifier for arrays breaks code reformatting in the Playground.

// comment out to allow reformatting
const oops: readonly number[] = [1, 2, 3];
/*
SyntaxError: "',' expected. (2:22), parser-typescript.js
> 2 | const oops: readonly number[] = [1, 2, 3];
    |                      ^
*/

// Alt + Shift + F: IT DOES NOTHING!!!
const 
x 
= 
1;

Expected behavior:
Code reformats (so const x = 1; is moved to a single line)

Actual behavior:
Code does not reformat. A console error indicates that the readonly modifier is not expected.

Playground Link:
Playground Link

Related Issues:
microsoft/TypeScript#29435, introducing the readonly modifier for array types

@orta
Copy link
Contributor

orta commented Jul 15, 2019

Weird, looks like the prettier playground doesn't have this problem.

The new playground will go back to the built-in TS formatter, so you're welcome to look at maybe updating the prettier for this playground in the meantime.

@orta
Copy link
Contributor

orta commented Oct 3, 2019

Moving back to the TS formatter fixed this 👍

@orta orta closed this as completed Oct 3, 2019
@jcalz
Copy link
Author

jcalz commented Oct 3, 2019

Playground link still looks bad to me; so does staging... is there some website/playground release schedule or some other thing I'm missing?

@orta
Copy link
Contributor

orta commented Oct 3, 2019

It's on this PR: #76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants