Fast, zero-configuration Flow type annotation removal tool for JavaScript with CLI and programmatic APIs
84
Build a utility that transforms Flow-typed JavaScript by removing type declaration statements while preserving executable code.
Create a tool that processes JavaScript source code containing Flow type declarations and outputs clean JavaScript with all declare statements removed.
Your tool should:
"declare class Logger { }\nconst x = 5;", the output is "const x = 5;" with whitespace preserved @test"declare function process(data: any): number;\nfunction run() { return 1; }", the output contains the run function but no declare statement @test"declare var CONFIG: string;\nvar value = 'test';", the output contains only the value variable @test@generates
/**
* Removes Flow declare statements from JavaScript source code.
*
* @param {string} source - The JavaScript source code containing Flow declarations
* @param {Object} options - Configuration options (optional)
* @returns {Object} Result object with toString() method
*/
function stripDeclarations(source, options = {}) {
// Implementation here
}
module.exports = stripDeclarations;Provides Flow type annotation removal capabilities, including declare statement removal.
@satisfied-by
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