title: Converting eslint config from json to JavaScript throws error when exporting config
body: <p>I am trying to convert my eslint config from json to JavaScript.</p>
  <p>After exporting a config object from .eslintrc.js like it sys <a href="https://eslint.org/docs/user-guide/configuring" rel="nofollow noreferrer">in the docs</a>:</p>
  <blockquote>
  <p>JavaScript - use .eslintrc.js and export an object containing your configuration.</p>
  </blockquote>
  <p>I get the error:</p>
  <pre><code>(function (exports, require, module, __filename, __dirname) { export default {
                                                                ^^^^^^
  
  SyntaxError: Unexpected token export
      at new Script (vm.js:83:7)
  </code></pre>
  <p>This is the first couple of lines of my config:</p>
  <pre><code>export default {
      env: {
          browser: true,
  </code></pre>
  <p>How can I fix the error?</p>
  <h3>Update</h3>
  <p>I have named the object and exported the const but get this error:</p>
  <pre><code>const config = {
      env: {
  </code></pre>
  <pre><code>export default config;
  ^^^^^^
  
  SyntaxError: Unexpected token export
      at new Script (vm.js:83:7)
  </code></pre>