8000 New vue file will get `Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.` when typescript 3.9-4.0 in VSCode · Issue #2127 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content

New vue file will get Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. when typescript 3.9-4.0 in VSCode #2127

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

Closed
yoyo930021 opened this issue May 29, 2020 · 10 comments
Labels
external This issue is with another package, not typescript-eslint itself package: typescript-estree Issues related to @typescript-eslint/typescript-estree vue issues relating to vue support

Comments

@yoyo930021
Copy link
Contributor
yoyo930021 commented May 29, 2020

This problem will effect typescript 3.9~4.0 .
Fixed in typescript 4.1 #2127 (comment)

Repro
https://github.com/yoyo930021/typescript-eslint-vue-bug

module.exports = {
  root: true,
  parser: 'vue-eslint-parser',
  env: {
    es6: true,
    node: true,
  },
  extends: ['plugin:vue/essential'],
  parserOptions: {
    // Local version of @typescript-eslint/parser
    parser: '@typescript-eslint/parser',
    project: './tsconfig.json',
    sourceType: 'module',
    extraFileExtensions: ['.vue'],
  },
  plugins: [
    // Local version of @typescript-eslint/eslint-plugin
    '@typescript-eslint',
  ]
};
<template>
  <div></div>
</template>

<script>
export default {

}
</script>

<style>

</style>

Expected Result
All correct.
Actual Result

Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: src/App copy.vue.
The file must be included in at least one of the projects

Additional Info

  1. open minimal reproduction repro in vscode.
  2. copy App.vue to App copy.vue
  3. Get error.

May-29-2020 13-55-51

Versions

package version
@typescript-eslint/typescript-estree 3.0.2
TypeScript 3.9.3
node 13.14.0
npm 6.14.4
@yoyo930021 yoyo930021 added package: typescript-estree Issues related to @typescript-eslint/typescript-estree triage Waiting for team members to take a look labels May 29, 2020
@yoyo930021
Copy link
Contributor Author
yoyo930021 commented May 29, 2020

I think about #1813, #1833.
Perhaps typescript 3.9 does not listen about extra file extensions change?

@bradzacher bradzacher added bug Something isn't working help wanted Extra attention is needed and removed triage Waiting for team members to take a look labels May 29, 2020
@bradzacher
Copy link
Member

This will require some investigation - it should be work based on everything I understand.
I won't have bandwidth to look into this for some time, however.

@ericksonc
Copy link
ericksonc commented Jul 7, 2020

FWIW, I often get this error (usually on existing Vue single file components I've had open in the editor for a while) and then quitting and reopening VSCode makes it go away. It usually pops up again after a few hours, and I have no idea what's happening to trigger it though.

@yoyo930021
Copy link
Contributor Author

FWIW, I often get this error (usually on existing Vue single file components I've had open in the editor for a while) and then quitting and reopening VSCode makes it go away. It usually pops up again after a few hours, and I have no idea what's happening to trigger it though.

You can downgrade TypeScript to 3.8 temporarily.

@sbillet
Copy link
sbillet commented Sep 9, 2020

The problem is still present with TypeScript 4.0.2 (2020-08-21) and 3.9.7 (2020-07-16). On the other hand, the older 3.8.3 (2020-02-28) works fine for me.

@sheetalkamat You made a fix in TS related to 1813. Do you expect the change to fix this issue? If yes, in which TS release version will it be included?

@bradzacher
Copy link
Member

Vue is just not well supported by this project.

I don't have any experience in Vue, and I don't have the cycles to learn Vue and investigate whilst also maintaining everything else.

We'd love for someone from the Vue community to champion support.

Without a champion, this will likely remain broken.

@yoyo930021
Copy link
Contributor Author
yoyo930021 commented Sep 11, 2020

I studied it.

This is reason #2127 (comment).

I open a issue and add a test in TypeScript project.
microsoft/TypeScript#40495

@yoyo930021
Copy link
Contributor Author
yoyo930021 commented Oct 13, 2020

This problem will solved in TypeScript 4.1
microsoft/TypeScript#40495 (comment)

I will close issue when typescript 4.1 stable released.

@yoyo930021 yoyo930021 changed the title New vue file will get Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. when typescript 3.9 in VSCode New vue file will get Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. when typescript 3.9-4.0 in VSCode Oct 13, 2020
@bradzacher bradzacher added external This issue is with another package, not typescript-eslint itself and removed bug Something isn't working help wanted Extra attention is needed labels Oct 13, 2020
@yoyo930021
Copy link
Contributor Author

I'm also interested in helping with questions about Vue, TypeScript, ESLint.
If you have a similar problem, you can tag me to help you with it.

@yoyo930021
Copy link
Contributor Author

https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 21, 2020
@bradzacher bradzacher added the vue issues relating to vue support label Nov 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
external This issue is with another package, not typescript-eslint itself package: typescript-estree Issues related to @typescript-eslint/typescript-estree vue issues relating to vue support
Projects
None yet
Development

No branches or pull requests

4 participants
0