ESLint parsing error when using arrow syntax with asynchronous

I use ESLint to parse my code. The code works fine, but I get this error from eslint:

[eslint] Parsing error: Unexpected token t

(parameter) t: any

test.serial('set: Handles save error', async t => {
  // function definition
});

Here .eslintrc.js

module.exports = {
  extends: 'google',
  parserOptions: {
    ecmaVersion: 6
  }
};
+7
source share
1 answer

async/ awaitis an ECMAScript 2017 function, so if you change ecmaVersion: 8instead of 6, this should work!

+9
source

Source: https://habr.com/ru/post/1678962/


All Articles