【发布时间】:2021-08-12 00:29:39
【问题描述】:
这是带有装饰器的对象:
export default {
Query: {
@query
containerById: async (scope, { id }, context) => {
return context.loaders.containerLoader.getContainerById.load(id);
},
}
};
我试图抑制这个错误,但我无法做到。
我能够做到的唯一方法是将以下行添加到.vscode/settings.json
"typescript.validate.enable": false
这显然是一个糟糕的解决方案,因为它禁用了我不想要的所有打字稿验证。
这是我的tsconfig.json 文件:
{
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"allowJs": true,
"sourceMap": true,
"outDir": "./lib",
"strict": true,
"noImplicitAny": false,
"moduleResolution": "node",
"baseUrl": ".",
"paths": {
"/*": ["./src/*"]
},
"esModuleInterop": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
【问题讨论】:
标签: typescript visual-studio-code graphql