我看到了用 jsLint 抑制这个的方法,试过了,没用。
我需要“新”关键字,否则我的脚本不起作用。
如何在 .eslintrc 中抑制它?
非常感谢
更新:根据乔丹的要求。 [请注意我的应用程序是用 ReactJs 编写的]
// 3rd party
const AnimateSlideShow = require('../js-animation');
export default class Animate extends React.Component {
.......
fetchJsAnimation() {
const animation = this.refs.Animation;
new AnimateSlideShow(animation);
}
......
}
错误:不要将“新”用于副作用 no-new
现在,如果我满足 EsLint,我的应用程序就会出错:
未捕获(承诺中)类型错误:无法设置未定义(…)的属性“_handleMouse”