title: Optional chaining throwing parsing error on install
body: <p>I am trying to add the ability to perform optional chaining in my project.</p>
  <p>When I run npm i, getting following error.</p>
  <pre><code>Module build failed (from ./node_modules/eslint-loader/index.js):
  Module failed because of a eslint error.
    /Users/name/projects/src/utils/get.js
      12:20  error  Parsing error: Unexpected token
  
      10 |   }
      11 |
    &gt; 12 |   const some = map?.a?.b;
  </code></pre>
  <p>I added the following just to have some chaining syntax in my file which is causing the issue.</p>
  <pre><code>const get = () =&gt; props =&gt; {
  
    const map = {
      a: {
        b: null
      }
    }
  
    // will install fine if I remove this line
    const some = map?.a?.b;
  
  }
  </code></pre>
  <p>This is in a React project (react version 16.14.0)</p>
  <p>I have updated the eslint to version 7.5.0</p>
  <p>Added the following to the eslintrc.json file.</p>
  <pre><code>{
    &quot;parserOptions&quot;: {
      &quot;ecmaVersion&quot;: 2020
    }
  }
  </code></pre>
  <p>Under the .babelrc file added the following.</p>
  <pre><code>{
    &quot;plugins&quot;: [&quot;@babel/plugin-proposal-optional-chaining&quot;]
  }
  </code></pre>
  <p>This is my package.json file to see relevant dependencies.</p>
  <pre><code>{
    &quot;scripts&quot;: {
        .....
    },
    &quot;dependencies&quot;: {
      &quot;css-loader&quot;: &quot;2.1.1&quot;,
      &quot;lodash&quot;: &quot;^4.17.20&quot;,
      &quot;moment&quot;: &quot;^2.29.1&quot;,
      &quot;prop-types&quot;: &quot;^15.7.2&quot;,
      &quot;react&quot;: &quot;^16.14.0&quot;,
      &quot;react-helmet-async&quot;: &quot;^1.0.4&quot;,
      &quot;react-intl&quot;: &quot;^2.2.3&quot;,
      &quot;react-redux&quot;: &quot;^7.0.0&quot;,
      &quot;react-router&quot;: &quot;^3.0.0&quot;,
      &quot;react-swipeable&quot;: &quot;5.5.1&quot;,
      &quot;redux&quot;: &quot;^4.0.0&quot;,
      &quot;reselect&quot;: &quot;^4.0.0&quot;,
    },
    &quot;devDependencies&quot;: {
      &quot;@babel/plugin-proposal-optional-chaining&quot;: &quot;^7.16.7&quot;,
      &quot;@babel/polyfill&quot;: &quot;^7.4.4&quot;,
      &quot;amex-jest-preset-react&quot;: &quot;^5.0.0&quot;,
      &quot;eslint&quot;: &quot;^7.5.0&quot;,
      &quot;react-dom&quot;: &quot;^16.14.0&quot;,
    },
  }
  </code></pre>
  <p>Note that this is not a CRA (create react app).</p>
  <p>Could I please get some advice on why I am getting this parsing error? Thanks.</p>
  <p>Solutions from related queries not working for me.</p>
  <p><a href="https://stackoverflow.com/questions/61628947/eslint-optional-chaining-error-with-vscode">eslint - Optional chaining error with vscode</a></p>
  <p><a href="https://stackoverflow.com/questions/68049917/allow-using-syntax-in-eslint">Allow using ?. syntax in eslint</a></p>
  <p><a href="https://stackoverflow.com/questions/62541359/why-do-i-need-babel-plugin-proposal-optional-chaining-in-my-setup-using-bab">Why do I need &quot;@babel/plugin-proposal-optional-chaining&quot; in my setup using &quot;@babel/preset-env&quot; and &quot;@babel/preset-typescript&quot;</a></p>