<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
As the documentation describes, the @babel/plugin-proposal-decorators can be configured through the parameters: decoratorsBeforeExport and legacy.<br>
Somehow the combination of decoratorsBeforeExport: true &amp; legacy: true throws an error.</p>
<p dir="auto">Line of Code:<br>
</p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/babel/babel/blob/eac4c5bc17133c2857f2c94c1a6a8643e3b547a7/packages/babel-plugin-proposal-decorators/src/index.js#L25">babel/packages/babel-plugin-proposal-decorators/src/index.js</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 25
      in
      <a data-pjax="true" class="commit-tease-sha" href="/babel/babel/commit/eac4c5bc17133c2857f2c94c1a6a8643e3b547a7">eac4c5b</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L25" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="25"></td>
          <td id="LC25" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">"'decoratorsBeforeExport' can't be used with legacy decorators."</span><span class="pl-kos">,</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
In a recent v7 release (maybe even the final?), the parser <code class="notranslate">decorators</code> plugin option <code class="notranslate">decoratorsBeforeExport</code> no longer defaults as it used to.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const { parse } = require('@babel/core')

const result = parse(code, {
  parserOpts: {
    plugins: [
      'decorators'
    ]
  }
})"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-kos">{</span> parse <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/core'</span><span class="pl-kos">)</span>

<span class="pl-k">const</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-en">parse</span><span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
  <span class="pl-c1">parserOpts</span>: <span class="pl-kos">{</span>
    <span class="pl-c1">plugins</span>: <span class="pl-kos">[</span>
      <span class="pl-s">'decorators'</span>
    <span class="pl-kos">]</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">Results in an error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/Users/jaydenseric/Sites/demo/node_modules/@babel/core/lib/transformation/normalize-file.js:209
    throw err;
    ^

Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean."><pre class="notranslate"><code class="notranslate">/Users/jaydenseric/Sites/demo/node_modules/@babel/core/lib/transformation/normalize-file.js:209
    throw err;
    ^

Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean.
</code></pre></div>
<p dir="auto">This is unexpected, as <a href="https://babeljs.io/docs/en/babel-parser#plugins-options" rel="nofollow">the <code class="notranslate">decoratorsBeforeExport</code> option is meant to default to <code class="notranslate">false</code></a>. Manually providing the same value as the supposed default works:</p>
<div class="highlight highlight-source-diff notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  const result = parse(code, {
    parserOpts: {
      plugins: [
-       'decorators'
+       ['decorators', { decoratorsBeforeExport: false }]
      ]
    }
  })"><pre class="notranslate">  const result = parse(code, {
    parserOpts: {
      plugins: [
<span class="pl-md"><span class="pl-md">-</span>       'decorators'</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>       ['decorators', { decoratorsBeforeExport: false }]</span>
      ]
    }
  })</pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
A clear and concise description of what you expected to happen (or code).</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<p dir="auto">N/A.</p>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): v7.0.0</li>
<li>Node/npm version: Node.js v10.9.0, npm v6.4.0</li>
<li>OS: macOS</li>
<li>Monorepo [e.g. yes/no/Lerna]: No</li>
<li>How you are using Babel: [e.g. <code class="notranslate">cli</code>, <code class="notranslate">register</code>, <code class="notranslate">loader</code>]: API</li>
</ul>
<p dir="auto"><strong>Possible Solution</strong></p>
<p dir="auto"><strong>Additional context/Screenshots</strong></p>