diff --git a/packages/babel-parser/src/plugin-utils.js b/packages/babel-parser/src/plugin-utils.js index 8260bdc00c09..e378b0afda9f 100644 --- a/packages/babel-parser/src/plugin-utils.js +++ b/packages/babel-parser/src/plugin-utils.js @@ -55,8 +55,10 @@ export function validatePlugins(plugins: PluginList) { ); if (decoratorsBeforeExport == null) { throw new Error( - "The 'decorators' plugin requires a" + - " 'decoratorsBeforeExport' option, whose value must be a boolean.", + "The 'decorators' plugin requires a 'decoratorsBeforeExport' option," + + " whose value must be a boolean. If you are migrating from" + + " Babylon/Babel 6 or want to use the old decorators proposal, you" + + " should use the 'decorators-legacy' plugin instead of 'decorators'.", ); } else if (typeof decoratorsBeforeExport !== "boolean") { throw new Error("'decoratorsBeforeExport' must be a boolean."); diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-required/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-required/options.json index 6e76b5fb33dd..3a1e80661a8f 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-required/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-required/options.json @@ -1,4 +1,4 @@ { "plugins": ["decorators"], - "throws": "The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean." + "throws": "The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean. If you are migrating from Babylon/Babel 6 or want to use the old decorators proposal, you should use the 'decorators-legacy' plugin instead of 'decorators'." }