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

Incompatibility with typescript-eslint@2 #944

Closed
sem4phor opened this issue Aug 15, 2019 · 5 comments
Closed

Incompatibility with typescript-eslint@2 #944

sem4phor opened this issue Aug 15, 2019 · 5 comments

Comments

@sem4phor
Copy link

Tell us about your environment

  • ESLint version: 5.16.0
  • eslint-plugin-vue version: 5.02.3
  • Node version: 11.6.0

Please show your full configuration:
https://github.com/sem4phor/vue-typescript-eslint

What did you do?
I created a new repository with vue-cli3
I installed all dependencies for adding typescript-eslint@2.0.0
I upgraded typescript eslint to v2.0.0 (latest major release) and changed configuration according to: typescript-eslint/typescript-eslint#853 (comment)
Then i ran npm run lint

What did you expect to happen?
The template of the .vue files are linted without a parser error

What actually happened?
The parser did fail to parse the template (See error message in README of bug repro repo)

I am not sure if thats an issue of eslint-plugin -vue, the configuration or typescript-eslint. Maybe someone can help me out.

@ota-meshi
Copy link
Member

I removed vue/no-parsing-error by changing the setting.

I set parserOptions.createDefaultProgram to true and excluded .vue from include in tsconfig.eslint.json.

vue-eslint-parser tries to pass the script part of the vue file to @typescript-eslint/parser, but @typescript-eslint/parser may return the analysis result of another source code.
This is the source code contained in the cache used for parsing other files.
The source code contained in this cache is the result of all the lines in the vue file.
Since the analysis by @typescript-eslint/parser fails, the vue file is reported as a parsing error.

If you exclude .vue from include in tsconfig.eslint.json, it will not be cached in other file analysis.

But I don't know if this configuration change is correct.

@IlCallo
Copy link

IlCallo commented Aug 19, 2019

@ota-meshi as written here into createDefaultProgram description, you are more or less disabling v2 performance fixes, that's why its working.

Gonna reference this issue on their issue tracker too.
@mysticatea may be the right person to deal with this probably, if I remember well he was the one who wrote vue-eslint-parser.

Also, seems like that package still depends on ESLint 5 and didn't updated to ESLint 6, this may be one of the problems (vuejs/vue-eslint-parser#54).
I see you already submitted a PR for that vuejs/vue-eslint-parser#51

@Mister-Hope
Copy link
Contributor

Mister-Hope commented Aug 25, 2019

I still catch a little confused after seeing this and the referened issue. Is it a bug actually? Or not a bug, just conflict caused by them which needs extra configuration? So could you tell my how can I solve it now?

@IlCallo
Copy link

IlCallo commented Aug 26, 2019

AFAIK you cannot solve it.
Seems like someone is working on it tho, so you can subscribe to that issue and try @typescript-eslint/eslint-plugin@canary every while

@sem4phor
Copy link
Author

Fixed in https://github.com/typescript-eslint/typescript-eslint/releases/tag/v2.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants