【前端问题精选】怎樣讓特定寫法的的函數能被 idea 正確判斷為函數 而非 變量

以下代碼中 @FIXME 的部分 會被判斷為只是 值 為 函數 的 變量

export function a() {}

export const b = function () {};

export const c = () => {};

export const d = (() => {return () => {}})(); // <== @FIXME;

export const A = { a, };

export const B = { b, } as {

b: typeof b, // <== @FIXME

};

// all is func type // ---------------------

// know these is a func

console.log(a, b, c);

console.log(A.a);

// --------------------

// @FIXME but think these is a var with func value

console.log(d);

console.log(B.b);

图片描述

以上是 【前端问题精选】怎樣讓特定寫法的的函數能被 idea 正確判斷為函數 而非 變量 的全部内容, 来源链接: utcz.com/a/132405.html

回到顶部