Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(cli-service-global): eslint doesn't use babel-eslint parser #2654

Closed
LinusBorg opened this issue Sep 29, 2018 · 2 comments · Fixed by #2655
Closed

(cli-service-global): eslint doesn't use babel-eslint parser #2654

LinusBorg opened this issue Sep 29, 2018 · 2 comments · Fixed by #2655

Comments

@LinusBorg
Copy link
Member

@LinusBorg LinusBorg commented Sep 29, 2018

Version

3.0.4

Reproduction link

https://gist.github.com/LinusBorg/e22ecd83a46a101840938dbc18d60bd2

Node and OS info

Node 10.8.0, npm 6.4.1

Steps to reproduce

  1. Copy code from the given gist link and paste it into an index.vue file
  2. run vue serve index.vue

What is expected?

Prototype app is served without any errrors or warnings

What is actually happening?

The app is served correctly, but we get eslint warnings in the console about async being an unexpected token:

error: Parsing error: Unexpected token hello at index.vue:10:12:
   8 |   export default {
   9 |     methods: {
> 10 |       async hello() {
     |            ^
  11 |         return 'hello'
  12 |       }
  13 |     }

The problem is that cli-service-global injects a baseconfig for eslint-loader, and this config doesn't include:

parserOptions: {
  parser: 'babel-eslint',
}

I'll submit a PR for this in a second.

@nicoabie

This comment has been minimized.

@sodatea

This comment has been minimized.

@sodatea sodatea closed this in #2655 Oct 7, 2018
sodatea pushed a commit that referenced this issue Oct 7, 2018
By including the parserOptions as we do when we create an actual eslint config for normal projects, we get ESnext support for eslint during `vue serve`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants