CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-flow-remove-types

Fast, zero-configuration Flow type annotation removal tool for JavaScript with CLI and programmatic APIs

84

1.09x
Overview
Eval results
Files

task.mdevals/scenario-5/

Flow Type Stripper

A command-line tool that processes JavaScript files and removes Flow type annotations, converting Flow-typed code to standard JavaScript.

Capabilities

Directory Processing with Extension Filtering

The tool should:

  • Process only files with specified extensions (e.g., .js, .jsx) @test
  • Handle multiple file extensions in a single operation @test
  • Skip files that don't match the extension filter @test

Requirements

Build a tool that processes all files in a directory, removing Flow type annotations. The tool must filter files by extension before processing.

Extension filtering requirements:

  • Accept a comma-separated list of extensions (e.g., .js,.jsx,.mjs)
  • Only process files matching the specified extensions
  • Process directories recursively
  • Default extensions when none specified: .js,.mjs,.cjs,.jsx,.flow,.es6

Implementation

@generates

API

/**
 * Processes files in a directory, removing Flow type annotations.
 * Filters files by extension before processing.
 *
 * @param {string} inputDir - Input directory path
 * @param {string} outputDir - Output directory path
 * @param {string} extensions - Comma-separated list of extensions (e.g., '.js,.jsx')
 * @returns {Object} Processing results with counts of processed and skipped files
 */
function processDirectory(inputDir, outputDir, extensions) {
  // IMPLEMENTATION HERE
}

module.exports = { processDirectory };

Dependencies { .dependencies }

flow-remove-types { .dependency }

Provides Flow type annotation removal functionality.

Install with Tessl CLI

npx tessl i tessl/npm-flow-remove-types

tile.json