我的 angular 專案中有以下箭頭函式:
this.httpClient.get('url').subscribe((response)=>{
});
在上面的代碼中,ESLint 應該因未指定回傳型別而引發錯誤。
uj5u.com熱心網友回復:
檢查規則@typescript-eslint/explicit-function-return-type。您需要將該選項設定allowTypedFunctionExpressions為false. 如果您使用 .eslintrc:
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowTypedFunctionExpressions": false
}
]
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/370689.html
標籤:有角的 打字稿 eslint eslintrc 打字稿-eslint
上一篇:如何在python中讀取檔案然后根據檔案中的名稱創建檔案夾
下一篇:Discord.js:commands.map不是ApplicationCommandManager.set的函式
