[英]How can i set an eslint rule for no-undefined?
I am trying to make a simple function which will redirect the user to the home page, as the name say. 我正在尝试制作一个简单的函数,该函数会将用户重定向到首页,如名称所示。 I can't get rid of this error: 我无法摆脱这个错误:
*ReferenceError: location is not defined * ReferenceError:未定义位置
Can someone help me with this, using eslint? 有人可以使用eslint帮助我吗?
export function goToHomePage() {
location = '/';
}
I am using backbone.js MVC 我正在使用骨干.js MVC
Try setting your ESLINT config to: 尝试将ESLINT配置设置为:
var esLintDevConfig = {
env: {
"browser": true,
"node": true,
"jquery": true
},
"globals": {
"angular": true, "window": true, //anyother global variables
},
rules: {
}
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.