我试图使用Webpack 1.13.12和eslint 3.11.0和eslint-plugin-promise 3.4.0。我试图使用回答in this question让Superagent产生Web服务调用的结果。“关键字收益率保留”eslint错误
import agent from 'superagent';
require('superagent-as-promised')(agent);
import Promise from 'promise';
const API_URL = 'http://localhost/services/merchant';
export function createVendorCall() {
const responsePromise = yield Promise.resolve(agent.put(`${API_URL}/create`));
let response = responsePromise.next();
return response.body;
}
当我尝试皮棉此,eslint抱怨The keyword 'yield' is reserved.
我试过在我.eslintrc.json文件中设置require-yield
为0,但它仍然不会掉毛。使用内联注释来禁用eslint也不起作用。
我该怎么办?我是否以错误的方式使用Superagent,或者是否有必须禁用的规则?
编辑:这个问题被标记为this question的副本。但是,这个问题没有使用棉绒,而是有不同的错误信息。这里的问题是eslint会将看起来有效的语法标记为错误。
'然而,这个问题没有使用linter并且有不同的错误信息 - >除了它不是有效的语法,并且这两个问题具有完全相同的原因。 – Carpetsmoker
他们,对不起,我问。 – Brad