eslint-plugin-es5 icon indicating copy to clipboard operation
eslint-plugin-es5 copied to clipboard

Does not catch Async/Await

Open joeljeske opened this issue 7 years ago • 0 comments

It appears that this plugin does not catch instances of async/await in code. My current setup:

I am currently bundling my code with Webpack 4 and using dynamic import() static import from in my otherwise ES5 JS files. When I started using import(), I was getting a parsing error:

error: Parsing error: Unexpected token import at ....

And according to many other threads, they suggest using the "babel-eslint" parser so I added that to my .eslintrc. (https://github.com/vuejs/eslint-plugin-vue/issues/204)

But now, async/await (and maybe other things?) are successfully being parsed and then not being caught by this plugin.

I would think that this plugin should catch all non-ES5 compliant code which is why I am filing this bug. If you are aware of another way to use dynamic import() with eslint without the "babel-eslint" plugin, I would also be interested in that approach and relying on parsing errors for non ES5 language constructs.

Thanks!

joeljeske avatar Sep 20 '18 16:09 joeljeske