3
我正在使用eslint和flowtype。直到我決定使用es6發電機,它一直在運行。當我導出一個生成器時,我需要指定返回類型,但eslint不能識別生成器類型。流量生成器類型未被eslint識別
export function *gen2(): Generator {
yield 'test';
}
Eslint顯示此錯誤:'Generator' is not defined.
但流程完美。
任何人有任何想法如何使eslint識別發電機類型?
您還可以使用巴貝爾,eslint + https://github.com/gajus/eslint-plugin-flowtype + **的https://github.com/zertosh/eslint-plugin-flow-vars* * – Nihau