Registry / type-stubs / babel-flow-types

babel-flow-types

JSON →
library1.2.3jsnpmunverified

Provides Flow type definitions for Babel's public API, including types for AST nodes, parsers, transformers, and code generation. Current stable version is 1.2.3. This package is specifically for Flow users who need type coverage when working with Babel's ecosystem, offering types that mirror Babel's internal structures. It is updated infrequently to match Babel's releases. Compared to TypeScript-oriented alternatives like @babel/types, this package is the primary source for Flow consumers relying on Babel.

npm install babel-flow-types
INSTALL
IMPORT
SIG · BABEL-FLOW-TYPES
B
babel-flow-types
type-stubsjavascriptv1.2.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BabelNodeFile
import type { BabelNodeFile } from 'babel-flow-types'
import { BabelNodeFile } from 'babel-flow-types'
This package exports Flow types, so import with 'import type' in Flow or ignore in non-Flow contexts.
BabelNodeIdentifier
import type { BabelNodeIdentifier } from 'babel-flow-types'
const BabelNodeIdentifier = require('babel-flow-types').BabelNodeIdentifier
CommonJS require is not recommended for type imports; use ESM style.
BabelPluginPass
import type { BabelPluginPass } from 'babel-flow-types'
import { BabelPluginPass } from '@babel/core'
Incorrect import path; the type is in this package, not @babel/core.

Shows how to import and use a BabelFlow type in a Flow-typed file.

// @flow import type { BabelNodeFile } from 'babel-flow-types'; function processFile(node: BabelNodeFile) { console.log(node.program.body); } processFile({ type: 'File', program: { type: 'Program', body: [], directives: [], sourceType: 'module', interpreter: null } });
Debug
Known issues
deprecatedThis package is in maintenance mode and may not be updated for newer Babel versions.
fix
Consider migrating to TypeScript with @babel/types or continue using Flow with caution.
affects: >=1.0
gotchaFlow type definitions may not cover all Babel APIs; some types are missing or incomplete.
fix
Check the package's source to see defined types; supplement with custom type definitions as needed.
affects: >=1.0
gotchaImporting types incorrectly (e.g., with default import) will cause Flow errors.
fix
Use named type imports as shown in the examples.
affects: >=1.0
Errors
Common errors & fixes
Cannot resolve 'babel-flow-types'.
Package not installed or not in node_modules.
fix
Run 'npm install babel-flow-types' to add it to dependencies.
TypeError: Cannot read properties of undefined (reading 'body')
Trying to use BabelNodeFile as a runtime value instead of a type.
fix
Remove 'type' keyword from import to import the actual value, but note that this package only exports types.
Flow: Cannot resolve module 'babel-flow-types'.
Flow cannot locate the package because it's a flow-typed library or not in flow-typed.
fix
Add '// flow-typed' comment or install flow-typed definitions for babel-flow-types.
Upgrade
Version history
1.2.3latest on npm
Audit
Dependencies
flow-binoptionalruntime dependency for Flow type checking
Agent activity
42 hits · last 30 days
node
36
OpenAI (training)
1
Resources
babel-flow-types — npm install babel-flow-types · libregistry