{"id":18993,"library":"babel-flow-types","title":"babel-flow-types","description":"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.","status":"maintenance","version":"1.2.3","language":"javascript","source_language":"en","source_url":"https://github.com/babel-utils/babel-flow-types","tags":["javascript"],"install":[{"cmd":"npm install babel-flow-types","lang":"bash","label":"npm"},{"cmd":"yarn add babel-flow-types","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-flow-types","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"runtime dependency for Flow type checking","package":"flow-bin","optional":true}],"imports":[{"note":"This package exports Flow types, so import with 'import type' in Flow or ignore in non-Flow contexts.","wrong":"import { BabelNodeFile } from 'babel-flow-types'","symbol":"BabelNodeFile","correct":"import type { BabelNodeFile } from 'babel-flow-types'"},{"note":"CommonJS require is not recommended for type imports; use ESM style.","wrong":"const BabelNodeIdentifier = require('babel-flow-types').BabelNodeIdentifier","symbol":"BabelNodeIdentifier","correct":"import type { BabelNodeIdentifier } from 'babel-flow-types'"},{"note":"Incorrect import path; the type is in this package, not @babel/core.","wrong":"import { BabelPluginPass } from '@babel/core'","symbol":"BabelPluginPass","correct":"import type { BabelPluginPass } from 'babel-flow-types'"}],"quickstart":{"code":"// @flow\nimport type { BabelNodeFile } from 'babel-flow-types';\n\nfunction processFile(node: BabelNodeFile) {\n  console.log(node.program.body);\n}\n\nprocessFile({ type: 'File', program: { type: 'Program', body: [], directives: [], sourceType: 'module', interpreter: null } });","lang":"javascript","description":"Shows how to import and use a BabelFlow type in a Flow-typed file."},"warnings":[{"fix":"Consider migrating to TypeScript with @babel/types or continue using Flow with caution.","message":"This package is in maintenance mode and may not be updated for newer Babel versions.","severity":"deprecated","affected_versions":">=1.0"},{"fix":"Check the package's source to see defined types; supplement with custom type definitions as needed.","message":"Flow type definitions may not cover all Babel APIs; some types are missing or incomplete.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Use named type imports as shown in the examples.","message":"Importing types incorrectly (e.g., with default import) will cause Flow errors.","severity":"gotcha","affected_versions":">=1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install babel-flow-types' to add it to dependencies.","cause":"Package not installed or not in node_modules.","error":"Cannot resolve 'babel-flow-types'."},{"fix":"Remove 'type' keyword from import to import the actual value, but note that this package only exports types.","cause":"Trying to use BabelNodeFile as a runtime value instead of a type.","error":"TypeError: Cannot read properties of undefined (reading 'body')"},{"fix":"Add '// flow-typed' comment or install flow-typed definitions for babel-flow-types.","cause":"Flow cannot locate the package because it's a flow-typed library or not in flow-typed.","error":"Flow: Cannot resolve module 'babel-flow-types'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}