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

@yoyo930021

Description

@yoyo930021

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    externalThis issue is with another package, not typescript-eslint itselfpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estreevueissues relating to vue support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy