Skip to content

Idea: leave type annotations as comments #1

Open
@bmakuh

Description

@bmakuh

I tried out Gear on a little tinkering project over the weekend (https://github.com/bmakuh/quip-mass-exporter/blob/master/index.js#L16) and I found myself continuing to comment out the type annotations so I could just run my script directly in Node rather than having to compile it first. What would you think about the possibility of having Gear parse type annotations in comments? That way it would continue to remain standards-compliant JS while gaining the ability to be type-checkable.

You could do something like require the line to start with triple slashes /// or something so that you wouldn't have to parse every comment, and you could limit it to only comments directly above a function definition or assignment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions