How to use flow-remove-types - 2 common examples

To help you get started, we’ve selected a few flow-remove-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ritz078 / snape / tools / scripts / removeFlow.js View on Github external
.forEach((file) => {
    console.log(`Removing types from "${file}`);
    const input = fs.readFileSync(file, 'utf8');
    const withoutFlow = flowRemoveTypes(input).toString();
    const cleanedUp = withoutFlow
      // Remove the empty flow tags.
      .replace(/\/\*\s+\*\/\n/g, '')
      // Remove any blank lines at top of file.
      .replace(/^\n+/, '')
      // Remove any multiple blank lines in files.
      .replace(/\n\n+/g, '\n\n');
    fs.writeFileSync(file, cleanedUp);
  });
github strues / boldr / internal / scripts / removeFlow.js View on Github external
.forEach((file) => {
    console.log(`Removing types from "${file}`);
    const input = fs.readFileSync(file, 'utf8');
    const withoutFlow = flowRemoveTypes(input).toString();
    const cleanedUp = withoutFlow
      // Remove the empty flow tags.
      .replace(/\/\*\s+\*\/\n/g, '')
      // Remove any blank lines at top of file.
      .replace(/^\n+/, '')
      // Remove any multiple blank lines in files.
      .replace(/\n\n+/g, '\n\n');
    fs.writeFileSync(file, cleanedUp);
  });

flow-remove-types

Removes Flow type annotations from JavaScript files with speed and simplicity.

MIT
Latest version published 7 days ago

Package Health Score

91 / 100
Full package analysis

Popular flow-remove-types functions