Search code examples
javascriptnode.jsfirebasenpmfirebase-cli

Firebase Functions predeploy parsing error run lint


When i try to deploy my Firebase Functions it gets an parse error. I am using cmd on Windows and i am coding in JavaScript. A couple of days ago i deployed my Functions on Mac and it worked, today i wanted to do the same thing on windows. After i tried it on Windows and it didn't worked, i tried it on mac again and it did not worked eather, even if it worked before.

I tried to change the firebase.json from "predeploy":[ "npm --prefix "$RESOURCE_DIR" run lint" ] to: "predeploy": [ "npm --prefix "%RESOURCE_DIR%" run lint" ]

but this was alos not working.

Can anybody help me out here? Thanks in advance :)

enter image description here


Solution

  • You need to update your lint file to account for the new ECMA script. Add the ecmaVersion key-value pair to your eslintrc.js file.

    module.exports = {
      root: true,
      env: {
        es6: true,
        node: true,
      },
      parserOptions: {
        "ecmaVersion": 2020, // add this
      },
      extends: [
        "eslint:recommended",
        "google",
      ]
    };