{"id":20160,"library":"jsdoc-babel","title":"jsdoc-babel","description":"jsdoc-babel is a JSDoc plugin that transforms ES6+ source files with Babel before JSDoc processes them. At version 0.5.0, it allows JSDoc to handle unsupported syntax (e.g., modern JavaScript, Flow, TypeScript) by leveraging Babel's transpilation pipeline. The plugin is lightweight, requires only @babel/core as a peer dependency, and integrates via JSDoc's configuration. It supports custom file extensions (default .js) and allows Babel options to be passed directly in the JSDoc config or via .babelrc. Compared to alternatives like jsdoc-babel-only, it is simpler and more directly tied to Babel 7+.","status":"maintenance","version":"0.5.0","language":"javascript","source_language":"en","source_url":"https://github.com/ctumolosus/jsdoc-babel","tags":["javascript","jsdoc","babel","plugin"],"install":[{"cmd":"npm install jsdoc-babel","lang":"bash","label":"npm"},{"cmd":"yarn add jsdoc-babel","lang":"bash","label":"yarn"},{"cmd":"pnpm add jsdoc-babel","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for Babel transformations.","package":"@babel/core","optional":false}],"imports":[{"note":"This is a JSDoc plugin, not a regular npm module. It is loaded by JSDoc at runtime via configuration, not by import/require.","wrong":"import jsdocBabel from 'jsdoc-babel'","symbol":"jsdoc-babel plugin","correct":"Use the string 'node_modules/jsdoc-babel' in JSDoc config's plugins array."},{"note":"Options defined in JSDoc config take precedence over .babelrc. Set 'babelrc': false to disable .babelrc resolution.","wrong":"Using .babelrc without overriding in JSDoc config - options merge may cause conflicts.","symbol":"Babel options","correct":"Add 'babel' key to JSDoc config JSON. Example: { 'plugins': ['node_modules/jsdoc-babel'], 'babel': { 'presets': ['@babel/env'] } }"},{"note":"Default extension is only '.js'. Add custom extensions explicitly.","wrong":"Assuming all file extensions are processed automatically.","symbol":"File extensions","correct":"Specify 'babel.extensions' array in JSDoc config to include additional extensions like 'es6', 'jsx'."}],"quickstart":{"code":"{\n  \"plugins\": [\"node_modules/jsdoc-babel\"],\n  \"babel\": {\n    \"extensions\": [\"js\", \"es6\", \"jsx\"],\n    \"presets\": [\"@babel/preset-env\"],\n    \"babelrc\": false\n  }\n}","lang":"javascript","description":"JSDoc configuration that enables the plugin, processes .es6 and .jsx files, and passes Babel options directly (ignoring .babelrc)."},"warnings":[{"fix":"Add the desired extensions to the 'babel.extensions' array in your JSDoc configuration.","message":"Plugin only processes files with .js extension by default. Files with other extensions (e.g., .es6, .jsx) will not be transformed unless you add them to the 'babel.extensions' array.","severity":"gotcha","affected_versions":">=0.1"},{"fix":"Set 'babelrc': false in JSDoc config to disable .babelrc resolution, or ensure no conflicting options.","message":"Options defined in JSDoc config take precedence over those in .babelrc. Unexpected merging behavior can occur if both are present.","severity":"gotcha","affected_versions":">=0.1"},{"fix":"Monitor for updates or consider using JSDoc's built-in Babylon parser if you do not need Babel transforms.","message":"The plugin uses the older Babel 7 API (babel.transform), which may not support newer Babel 7.x features or preset syntax. Future Babel versions might break compatibility.","severity":"deprecated","affected_versions":"0.5.x"}],"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/core --save-dev' to install the peer dependency.","cause":"@babel/core is a peer dependency; not installed.","error":"Error: JSDoc plugin \"node_modules/jsdoc-babel\" failed to load: Cannot find module '@babel/core'"},{"fix":"Add the file extension to the 'babel.extensions' array in JSDoc config.","cause":"JSDoc cannot parse a non-.js file because the plugin's extensions list does not include that file's extension.","error":"Error: Unable to parse source file: ... You may need an appropriate loader to handle this file type."},{"fix":"Ensure 'babel' config in JSDoc includes required presets (e.g., '@babel/preset-env') and set 'babelrc': false if you rely solely on JSDoc config.","cause":"Plugin transforms fail silently, leaving files unparsed because .babelrc is ignored or misconfigured.","error":"JSDoc reports no documented source files."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}