【发布时间】:2019-09-14 14:38:29
【问题描述】:
我有一些迭代的代码,它运行良好。安装 eslint 后,我的代码之一由 eslint 生成错误。
我的代码是:
for (const column of columns) {
for (const slugname of result[column.name]) {
const alphabet = slugname.slugname;
if (total[alphabet]) {
total[alphabet] += column.value;
} else {
total[alphabet] = column.value;
}
}
}
eslint 会生成一个错误
error iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations no-restricted-syntax
非常感谢任何帮助或建议。据我说代码写得很精确,很小,不知道eslint错误的线索
【问题讨论】:
标签: javascript ecmascript-6 eslint eslint-config-airbnb