{"id":19325,"library":"babel-preset-proposals","title":"babel-preset-proposals","description":"A Babel 7 preset that manages experimental proposal plugin dependencies, ordering, and default options. Current version 0.4.0 (released 2021-02-24), requires Node >=10. Key differentiators: automatically handles plugin ordering and option defaults for decorators and pipeline operator, removes plugins handled by @babel/preset-env, and supports all major TC39 proposals via boolean or object configuration. Release cadence is irregular; last release was over 3 years ago. Notable changes include removal of jsonStrings/nullishCoalescingOperator/optionalChaining options in v0.2.0 and addition of classStaticBlock in v0.4.0. This preset helps avoid common misconfigurations of Babel proposal plugins.","status":"maintenance","version":"0.4.0","language":"javascript","source_language":"en","source_url":"https://github.com/insin/babel-preset-proposals","tags":["javascript","babel-preset"],"install":[{"cmd":"npm install babel-preset-proposals","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-proposals","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-proposals","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for Babel presets to function","package":"@babel/core","optional":false},{"reason":"Required plugin for class properties proposal","package":"@babel/plugin-proposal-class-properties","optional":true},{"reason":"Required plugin for decorators proposal","package":"@babel/plugin-proposal-decorators","optional":true},{"reason":"Required plugin for pipeline operator proposal","package":"@babel/plugin-proposal-pipeline-operator","optional":true}],"imports":[{"note":"This is a CommonJS package; use require() in Node.js or configure in .babelrc/babel.config.js as a preset string.","wrong":"import preset from 'babel-preset-proposals'","symbol":"default","correct":"module.exports = require('babel-preset-proposals')"},{"note":"validateOptions is exported as a named export in CommonJS; destructure from require().","wrong":"import { validateOptions } from 'babel-preset-proposals'","symbol":"validateOptions","correct":"const { validateOptions } = require('babel-preset-proposals')"},{"note":"This package does not provide TypeScript type definitions. You must create your own type for options.","wrong":"import { PresetOptions } from 'babel-preset-proposals'","symbol":"PresetOptions","correct":"// No TypeScript types shipped; define your own interface"}],"quickstart":{"code":"// Install: npm install babel-preset-proposals\n// .babelrc or babel.config.js\n{\n  \"presets\": [\n    [\"babel-preset-proposals\", {\n      \"classProperties\": true,\n      \"decorators\": { \"legacy\": true },\n      \"exportDefaultFrom\": true,\n      \"numericSeparator\": true,\n      \"loose\": true\n    }]\n  ]\n}\n\n// Programmatic usage (Node.js CJS):\nconst proposalsPreset = require('babel-preset-proposals');\nconst babel = require('@babel/core');\nconst result = babel.transformSync('code', {\n  presets: [[proposalsPreset, { classProperties: true }]]\n});\nconsole.log(result.code);","lang":"javascript","description":"Shows both .babelrc JSON configuration and programmatic CommonJS usage with options like classProperties, decorators, and loose mode."},"warnings":[{"fix":"Remove these options from preset config; enable via @babel/preset-env's targets or use the plugins directly if needed.","message":"Removed options jsonStrings, nullishCoalescingOperator, optionalChaining; these plugins are now handled by @babel/preset-env (v0.2.0).","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Update preset config: replace 'decorators: true' with 'decorators: {legacy: true}' for legacy behavior.","message":"Decorators default changed from {legacy: true} to no default; you must explicitly specify {legacy: true} to preserve old behavior (v0.2.0).","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Upgrade Node.js to version 10 or higher for v0.4.0.","message":"Node.js 8 required; dropped support for Node 6 (v0.3.0). v0.4.0 requires Node >=10.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Add missing plugins individually, e.g., @babel/plugin-proposal-private-methods.","message":"Some proposal plugins like classPrivateMethods and staticClassFeatures are not included; users must add them manually.","severity":"deprecated","affected_versions":"*"},{"fix":"Set absolutePaths: true if generating config for external consumption or using with tools like Webpack's babel-loader.","message":"Using absolutePaths: true is required if the config is used outside the project's node_modules scope; otherwise Babel may fail to resolve plugins.","severity":"gotcha","affected_versions":"*"}],"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-preset-proposals' and ensure your .babelrc is in the project root.","cause":"Package not installed or not in node_modules path.","error":"Error: [BABEL] unknown preset: 'babel-preset-proposals'"},{"fix":"Check the README for valid options; for removed options, use @babel/preset-env or the plugin directly.","cause":"Passed options not recognized by the preset, e.g., 'optionalChaining: true' in v0.2.0+.","error":"Error: Plugin .option is not a valid Plugin property"},{"fix":"Ensure each option is either boolean or an Object as documented.","cause":"Using preset with an invalid option value (e.g., passing a string instead of boolean/object).","error":"TypeError: Cannot read property 'replace' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}