Skip to content

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

Closed
@LinusBorg

Description

@LinusBorg

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions