[英]How to fix requireShorthandArrowFunctions
如何解決這個requireShorthandArrowFunctions箭頭函數,使其符合JSCS?
const doSomething = () => {
return new Promise((resolve, reject) => {
resolve('success');
});
};
我知道這已經過時但我遇到了同樣的問題。 我想出來是因為你的doSomething
函數只做了一件事 - 它返回了一個promise。 所以,從技術上講,你不應該使用return
語句和花括號:
const doSomething = () => new Promise((resolve, reject) => {
resolve("success");
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.