Gur*_*ofu 1 intellij-idea typescript eslint vue.js
当我打开.vue
文件时,我的 IntelliJ IDEA 中出现以下错误:
Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: XX\XX\CurrentFile.vue.
The file must be included in at least one of the projects provided.
Run Code Online (Sandbox Code Playgroud)
当然,如果你教我解决方案,我会很高兴,但首先我知道它意味着什么以及为什么会出现。
我怀疑这是某种错误或不准确的错误消息。实验上已知:
eslint
从控制台运行某个.vue
文件,eslint 将正确完成执行。所以看起来它不是 eslint 错误。我的 Eslint 配置(YAML):
Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: XX\XX\CurrentFile.vue.
The file must be included in at least one of the projects provided.
Run Code Online (Sandbox Code Playgroud)
打字稿设置:
parser: vue-eslint-parser
parserOptions:
parser: "@typescript-eslint/parser"
sourceType: module
project: tsconfig.json
tsconfigRootDir: ./
extraFileExtensions: [ ".vue" ]
env:
es6: true
browser: true
node: true
plugins:
- "@typescript-eslint"
- vue
rules:
// ...
Run Code Online (Sandbox Code Playgroud)
您需要将文件添加到include
tsconfig 中的数组中:
"include": [
"path/to/src/**/*"
]
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7306 次 |
最近记录: |