Skip to content

Match flow types in babel-types to our type support #512

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

Closed
4 tasks
tmcw opened this issue Aug 25, 2016 · 5 comments
Closed
4 tasks

Match flow types in babel-types to our type support #512

tmcw opened this issue Aug 25, 2016 · 5 comments

Comments

@tmcw
Copy link
Member

tmcw commented Aug 25, 2016

https://github.com/babel/babel/blob/master/packages/babel-types/src/definitions/flow.js

Make sure these are all covered.

TODO: I don't see clear JSDoc/doctrine equivalents for any of these, unfortunately.

  • TypeofTypeAnnotation
  • IntersectionTypeAnnotation
  • ThisTypeAnnotation
  • BooleanLiteralTypeAnnotation
arv added a commit to arv/documentation that referenced this issue Sep 1, 2016
This adds support for `void` and `null` in type annotations:

```js
function f(): void {}
function g(): null {
  return null;
}
```

Towards documentationjs#512
tmcw pushed a commit that referenced this issue Sep 1, 2016
This adds support for `void` and `null` in type annotations:

```js
function f(): void {}
function g(): null {
  return null;
}
```

Towards #512
@arv
Copy link
Contributor

arv commented Sep 1, 2016

Our tests uses BooleanLiteralTypeAnnotation but it isn't supported in Doctrine and if you try to generate HTML from it, it fails.

@arv
Copy link
Contributor

arv commented Sep 2, 2016

Created a fix for doctrine: eslint/doctrine#173

@arv
Copy link
Contributor

arv commented Sep 13, 2016

Turns out that Doctrine does not support optional fields in object types:

type Record = {
  opt?: number,
  req: string,
}

@arv
Copy link
Contributor

arv commented Sep 13, 2016

Also, type parameters in type defs.

type F<T, V> = (x: T) => V;

arv added a commit to arv/documentation that referenced this issue Sep 15, 2016
This is done with Doctrine's OptionalType, which Doctrine is only
using for parameter types as of now.

Towards documentationjs#512
tmcw pushed a commit that referenced this issue Sep 19, 2016
This is done with Doctrine's OptionalType, which Doctrine is only
using for parameter types as of now.

Towards #512
arv added a commit to arv/documentation that referenced this issue Oct 14, 2016
Update Doctrine to 1.5 to pick up BooleanLiteralType.

Make sure we can output html/md for BooleanLiteralType.

Towards documentationjs#512
@arv arv mentioned this issue Oct 14, 2016
tmcw pushed a commit that referenced this issue Oct 24, 2016
Update Doctrine to 1.5 to pick up BooleanLiteralType.

Make sure we can output html/md for BooleanLiteralType.

Towards #512
@tmcw
Copy link
Member Author

tmcw commented Apr 25, 2017

Change of plans: we're going to support Flow types as well as JSDoc types in core. Closing in favor of #725

@tmcw tmcw closed this as completed Apr 25, 2017
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