More helpful error message for missing decoratorsBeforeExport in parser (#8576)
This commit is contained in:
parent
04d09cc754
commit
9d244ae66b
@ -55,8 +55,10 @@ export function validatePlugins(plugins: PluginList) {
|
|||||||
);
|
);
|
||||||
if (decoratorsBeforeExport == null) {
|
if (decoratorsBeforeExport == null) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"The 'decorators' plugin requires a" +
|
"The 'decorators' plugin requires a 'decoratorsBeforeExport' option," +
|
||||||
" 'decoratorsBeforeExport' option, whose value must be a boolean.",
|
" 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") {
|
} else if (typeof decoratorsBeforeExport !== "boolean") {
|
||||||
throw new Error("'decoratorsBeforeExport' must be a boolean.");
|
throw new Error("'decoratorsBeforeExport' must be a boolean.");
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"plugins": ["decorators"],
|
"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'."
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user