typescript-eslint: False positives when using with Vue SFC

What code were you trying to parse? I’m using Quasar (Vue based, using SFCs) and there seems to be some kind of incompatibility between typescript-eslint/parser and vue-eslint-parser.

Related https://github.com/vuejs/eslint-plugin-vue/issues/944 https://github.com/mysticatea/vue-eslint-parser/issues/55

What did you expect to happen? Linting working normally even in .vue files, given that it kind-of worked (with some limitations) pre v2.

What actually happened? All .vue files show a low level Parsing error: '>' expected error. Most rules somewhat related to JS/TS into templates linting will also fail. In my case every v-if, v-on and v-bind usage generate an error corresponding to the usage of that directive.

Es. image

Versions

package version
@typescript-eslint/parser 2.0.0
vue-eslint-parser 6.0.4
eslint-plugin-vue 5.2.3
TypeScript 3.5.3
ESLint 6.2.0
node 10.15.3
npm 6.4.1
yarn 1.16.0

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 7
  • Comments: 16 (6 by maintainers)

Most upvoted comments

Late to the party (pretty busy on a project), but I confirm too that issues are gone!

I have the same problem. The problem will only appear when I lint multiple files.

It’d be great if people could create a local build of that PR and link it in to see if it covers all of the use cases. Nothing complicated - checkout the branch at that PR (or use github to download a zip), cd in, yarn install, then grab the dist folder in packages/typescript-estree and dump it into your repo’s local node_modules/@typescript-eslint/typescript-estree folder. Running a lint will use the patched code, and we can verify the fix before merging it in.

@yoyo930021 - I’m just trepidatious because we’ve had many changes and tests that pass locally that don’t work for vue users IRL.