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

Check JS Doc / other type annotations #62

Open
kaleidawave opened this issue Sep 15, 2023 · 1 comment
Open

Check JS Doc / other type annotations #62

kaleidawave opened this issue Sep 15, 2023 · 1 comment
Labels
feedback-needed Extra attention/consensus is needed needs-investigation Further information is requested

Comments

@kaleidawave
Copy link
Owner

#57 Added basic support for reading comments as type annotations in certain positions:

error:
  ┌─ ./private/test-files/demo.ts:1:24
  
1  const x /* string */ = 4;
              ------      ^ Type 4 is not assignable to type string
              
              Variable declared with type string

There is also JS Doc, which contains type annotations. Ezno's synthesis could parse these comments (so done inside the checker, rather than the parser) and pass them off as the type annotation if there isn't one.

Additionally, could there be changes Ezno could make to support things that currently aren't representable in JS Doc?

@kaleidawave kaleidawave added feedback-needed Extra attention/consensus is needed needs-investigation Further information is requested labels Sep 15, 2023
@kaleidawave
Copy link
Owner Author

Turns out this is already in Flow https://flow.org/en/docs/types/comments/

(And some other project that I cannot find rn)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback-needed Extra attention/consensus is needed needs-investigation Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant