title: Firebase Cloud Function increment counter in Firestore on CreateUser
body: <p>I would like to use Firebase Cloud Functions to update a value inside my Cloud Firestore database everytime a new user is created. This is how my <code>index.js</code> looks:</p>
  <pre><code>const functions = require('firebase-functions');
  
  export const accountCreate = functions.auth.user().onCreate(user =&gt; {
      console.log(user.data);
      
      const FieldValue = require('firebase-admin').firestore.FieldValue;
      var userCounterRef = db.collection('data').doc('userCounter');
      userCounterRef.update({ count: FieldValue.increment(1) });
  });
  </code></pre>
  <p><strong>Problem:</strong>
  If I run <code>firebase deploy</code> I get this error:</p>
  <blockquote>
  <p>3:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType:
  module'</p>
  <p>✖ 1 problem (1 error, 0 warnings)</p>
  <p>Error: functions predeploy error: Command terminated with non-zero</p>
  <p>exit code1</p>
  </blockquote>
  <p>This is my <code>eslintrc</code> file:</p>
  <pre><code>module.exports = {
    root: true,
    env: {
      es6: true,
      node: true,
    },
    extends: [
      &quot;eslint:recommended&quot;,
      &quot;google&quot;,
    ],
    rules: {
      quotes: [&quot;error&quot;, &quot;double&quot;],
    },
  };
  </code></pre>
  <p>What am I missing here?</p>