Flow Configuration File Parser

0.3.0 · abandoned · verified Sun Apr 19

A utility package designed to parse `.flowconfig` files, enabling programmatic access to Flow type checker's configuration settings. The current and last published version of `flow-config-parser` is 0.3.0, released over seven years ago. While its repository `https://github.com/codemix/flow-runtime` remains active for other, related packages, `flow-config-parser` itself is no longer actively developed or maintained, making it effectively abandoned as a standalone package. It provides functions to inspect specific settings like `munge_underscores`, determine suppressed types, identify ignored files, and resolve module remapping directives within Flow's configuration.

Warnings

Install

Imports

Quickstart

Demonstrates how to import the parser, read a `.flowconfig` file, and use the resulting configuration object to query various Flow settings.

import fs from 'node:fs';
import parse from 'flow-config-parser';

const flowConfigContent = fs.readFileSync('.flowconfig', 'utf8');
const config = parse(flowConfigContent);

console.log('Munge underscores:', config.get('munge_underscores')); // Example: true or false
console.log('Suppresses type $flowIgnore:', config.suppressesType('$flowIgnore')); // Example: true or false
console.log('Suppresses type Boolean:', config.suppressesType('Boolean')); // Example: true or false
console.log('Ignores file node_modules/react/react.js:', config.ignoresFile('node_modules/react/react.js')); // Example: true or false
console.log('Remaps module foo.scss:', config.remapModule('foo.scss')); // Example: 'object-shim.js' or null

view raw JSON →