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

symbol is not a valid type, when it is? #2851

Closed
maraisr opened this issue Sep 18, 2017 · 2 comments
Closed

symbol is not a valid type, when it is? #2851

maraisr opened this issue Sep 18, 2017 · 2 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. priority:high Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent! scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency type:bug Issues identifying ugly output, or a defect in the program

Comments

@maraisr
Copy link

maraisr commented Sep 18, 2017

Prettier 1.7.0
Playground link

--parser typescript
--single-quote
--tab-width 4
--use-tabs

Input:

function test(abc: Map<symbol, string>) {}

Output:

Error: unknown type: undefined

Expected behaviour:
Things should lint correctly - So apparently, symbol is not a valid type, but TypeScript doesn't seem to complain. Symbol fixes the issue.

@ikatyang ikatyang added type:bug Issues identifying ugly output, or a defect in the program scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency priority:high Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent! lang:typescript Issues affecting TypeScript-specific constructs (not general JS issues) labels Sep 18, 2017
@ikatyang
Copy link
Member

Thanks for the report. I've opened eslint/typescript-eslint-parser#385 to fix this in our dependency.

As a temporary workaround you can put // prettier-ignore on the previous line.

+// prettier-ignore
function test(abc: Map<symbol, string>) {}

@maraisr
Copy link
Author

maraisr commented Sep 18, 2017

Thanks for that @ikatyang - can't wait :)

@azz azz closed this as completed in #2899 Sep 26, 2017
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 6, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 6, 2018
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. priority:high Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent! scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

No branches or pull requests

2 participants