【发布时间】:2020-10-18 02:49:52
【问题描述】:
我不知道为什么会出现这个错误
You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project"
这是我的配置
tsconfig
{
"compilerOptions": {
"target": "es6",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"jsx": "react",
"rootDir": "src",
"baseUrl": "src",
"paths": {
"@/*": [
"*"
]
},
"allowJs": true,
"resolveJsonModule": true
},
"include": [
"src"
],
"exclude": [
"src/main/test/cypress"
]
}
.eslintrc.json
{
"extends": "standard-with-typescript",
"parserOptions": {
"projects": "./tsconfig.json"
},
"rules": {
"@typescript-eslint/consistent-type-definitons": "off",
"@typescript-eslint/strict-boolean-expressions": "off"
}
}
我也有这个 AccountModel 类
export type AccountModel = {
accessToken: string
}
哪个 vscode 指出错误,说“解析错误:预期类型”我缺少什么?
【问题讨论】:
标签: typescript eslint