Skip to content

Commit

Permalink
More helpful error message for missing decoratorsBeforeExport in pars…
Browse files Browse the repository at this point in the history
…er (#8576)
  • Loading branch information
nicolo-ribaudo authored and existentialism committed Aug 29, 2018
1 parent 04d09cc commit 9d244ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/babel-parser/src/plugin-utils.js
Expand Up @@ -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.");
Expand Down
@@ -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'."
}

0 comments on commit 9d244ae

Please sign in to comment.