Fast, zero-configuration Flow type annotation removal tool for JavaScript with CLI and programmatic APIs
84
Build a command-line utility that removes Flow type annotations from JavaScript files while preserving the original code structure.
Your utility should accept JavaScript source code as input and output JavaScript with all type annotations removed. The tool should handle:
The output should be valid JavaScript that can be executed directly in Node.js without any type checking.
@flow pragma commentInput:
function greet(name: string) {
return "Hello, " + name;
}Output:
function greet(name ) {
return "Hello, " + name;
}Input:
function add(a, b): number {
return a + b;
}Output:
function add(a, b) {
return a + b;
}Input:
let count: number = 0;
const message: string = "hello";Output:
let count = 0;
const message = "hello";@generates
// Read from stdin, write to stdout
// Usage: node type-remover.js < input.js > output.jsProvides Flow type annotation removal functionality.
Install with Tessl CLI
npx tessl i tessl/npm-flow-remove-typesevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10