jareware / flotate Goto Github PK
View Code? Open in Web Editor NEWA portmanteau of flow and annotate, allows using the Flow type checker with standard JavaScript syntax, through inline annotation comments.
A portmanteau of flow and annotate, allows using the Flow type checker with standard JavaScript syntax, through inline annotation comments.
One might expect the "fancy annotations" (as in here) to work also on ES6 methods, such as:
var o = {
/* : (x: string, y: number): boolean */
foo(x, y) {
return x.length * y === 5;
}
};
but they currently don't, due to the comment block being assigned to the AST slightly differently.
See #4 for a related fix.
Does flotate support imported Flow types?
import type Type from './Type.js';
Maybe this is an auto-close if this is due to upstream Flow behavior, but function expressions do not seem to be supported with non-inline block comments. That's unfortunate because those are what CoffeeScript generates.
/* @flow */
/*: (n: number): string */
function named(n) { return 's'; }
/*: (n: number): string */
var aboveline = function(n) { return 's'; };
var aftervar /*: (n: number) => string */ = function(n) { return 's'; };
var beforeline = /*: (n: number): string */ function(n) { return 's'; };
var inline = function(n /*: number*/) /*: string*/ { return 's'; };
named('type error');
inline('type error');
aboveline('no type error');
aftervar('no type error');
beforeline('no type error');
Any reason why you didn't go with standard JSDoc annotation style for this project?
This is a great idea, thanks for creating it!
I'd love to use it with vim's syntastic plugin, but it relies on the --json flag that flow provides.
Opening this issue to get said flag on the radar.
(Edit: not inline annotation, but above the function.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.