Babel plugin that adds runtime type checking from Flow annotations using tcomb. Version 0.4.0, released 2020-09-05. This is the latest stable release; prior versions support Babel 6, latest supports Babel 7. Transforms Flow type annotations into runtime assertions via tcomb. Different from flow-remove-types or babel-plugin-transform-flow-strip-types because it keeps the type information for runtime validation. Works alongside Flow for hybrid static + dynamic checking. Supports refinement types, immutability enforcement, and IO boundary validation. Abandoned as of November 2021; no commits or releases since 0.4.0.
npm install babel-plugin-tcombVerified import paths — ran on the pinned version, not inferred.
Shows Babel setup and runtime type checking triggered by a Flow-annotated function call with a type mismatch.
Upgrade to Babel 7 or pin to 0.3.27 for Babel 6.
Consider alternatives like babel-plugin-runtime-typecheck or TypeScript with ttypescript.
Add plugin order: transform-modules-commonjs before tcomb, or use Babel env with modules: 'commonjs'.
Set passPerPreset: true in .babelrc.
Stick with v0.3.27 for Babel 6, or upgrade entire project to Babel 7.
npm install --save-dev tcomb
Correct the call to pass a number: sum(1, 2);
Ensure plugins array contains 'tcomb' after 'syntax-flow' and before 'transform-flow-strip-types'. Try passPerPreset: true.
Add import t from 'tcomb' at the top of your file, or ensure CommonJS require('tcomb') works.No dependency data recorded yet.