Babel preset that converts JSDoc type annotations into runtime assertion statements using babel-plugin-jsdoc-to-assert. Version 5.0.0 is current and requires Babel 7+. It is a thin wrapper around the core plugin, intended for easy integration via Babel presets. Release cadence is low; this package sees infrequent updates. Key differentiator: simplifies adding JSDoc-based runtime type assertions without manual checks.
npm install babel-preset-jsdoc-to-assertVerified import paths — ran on the pinned version, not inferred.
Install preset and transform JSDoc type annotations to runtime assertions via Babel CLI.
Upgrade to Babel 7 and use preset 'jsdoc-to-assert'.
Review generated assertions; see plugin changelog for details.
Combine with other presets (e.g., @babel/preset-env) for full compilation.
Use 'jsdoc-to-assert' in presets array.
Set presets: ['jsdoc-to-assert'] in .babelrc or babel.config.js.
Run npm install --save-dev babel-preset-jsdoc-to-assert and ensure Babel 7 is used.