Friday, 12 May 2017

eslint parsing error: Parsing error: Unexpected token =>

ESLint v3.19.0 gives a error "Parsing error: Unexpected token =>" at the following code.

How can I fix this?

module.exports = {

    index: async (req, res) => {
        await functionThatReturnsSomePromise();
  }
}

Also when I just use function it fails with the error "Parsing error: Unexpected token function"

module.exports = {

    index: async function(req, res) {
        await functionThatReturnsSomePromise();
  }
}



via Extranion

No comments:

Post a Comment