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

t.tsUnknownType is documented but doesn't exist #2079

Open
deificx opened this issue Aug 7, 2019 · 3 comments · May be fixed by #2080
Open

t.tsUnknownType is documented but doesn't exist #2079

deificx opened this issue Aug 7, 2019 · 3 comments · May be fixed by #2080
Assignees

Comments

@deificx
Copy link

deificx commented Aug 7, 2019

Bug Report

Current Behavior
Looking at the documentation for type there is a tsUnknownType, but calling the function gives a TypeError: t.tsUnknownType is not a function

Input Code

const generate = require("@babel/generator").default;
const t = require("@babel/types");

const ast = t.tsUnknownType([t.tsAnyKeyword()]);

const { code } = generate(ast);
console.log(code);

Expected behavior/code
I believe the output should be unknown.

Babel Configuration (.babelrc, package.json, cli command)
N/A, this is more a tooling bug than babel behavior bug

Environment

  • Babel version(s): 7.5.5
  • Node/npm version: Node v10.12.0 / yarn 1.17.3
  • OS: Ubuntu 18.04
  • How you are using Babel: api

Possible Solution
Searching through this repo yields nothing, it might not exist (yet)?

@babel-bot
Copy link
Contributor

Hey @deificx! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@JLHwung
Copy link
Contributor

JLHwung commented Aug 7, 2019

tsUnknownType was added in #1842. I believe it is a typo and we should replace tsUnknownType by tsUnknownKeyword.

@deificx PR's welcome.

@babel/core-team Could you transfer this issue to babel/website?

@nicolo-ribaudo nicolo-ribaudo transferred this issue from babel/babel Aug 7, 2019
@babel babel deleted a comment from babel-bot Aug 7, 2019
@deificx
Copy link
Author

deificx commented Aug 8, 2019

I will take a look at fixing that, ended up seeing if there are other mistakes at the same time, so will be a slightly bigger change then.

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.

3 participants