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

add flag for typescript to use unknown instead of any #1619

Open
safareli opened this issue Jan 4, 2021 · 1 comment · May be fixed by #2194
Open

add flag for typescript to use unknown instead of any #1619

safareli opened this issue Jan 4, 2021 · 1 comment · May be fixed by #2194

Comments

@safareli
Copy link

safareli commented Jan 4, 2021

It would be nice to allow some flag which results in use of unknown instead of any in the generated types.

@safareli
Copy link
Author

safareli commented Jan 4, 2021

Currently as I'm only generating types I'm doing this:

lines.map(line => 
  // Convert any to unknown. Related:
  line.replace(/([ <,])any\b/g,"$1unknown")
).join("\n")

RichiCoder1 added a commit to RichiCoder1/quicktype that referenced this issue Mar 1, 2023
Adds support for `unknown` (and it's flow equivalent) in TypeScript.

Closes glideapps#1619
@RichiCoder1 RichiCoder1 linked a pull request Mar 1, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant