Javascript 使用现有的Grunt项目-获取JSHint缺少分号和错误
在一个现有的GRUNT项目()中,我安装了npm,然后安装了GRUNT,我收到了大量的JSHint错误(缺少分号、空格和制表符、额外的逗号等)。我知道这个项目是在另一个系统上进行的 错误描述:Javascript 使用现有的Grunt项目-获取JSHint缺少分号和错误,javascript,node.js,angularjs,gruntjs,jshint,Javascript,Node.js,Angularjs,Gruntjs,Jshint,在一个现有的GRUNT项目()中,我安装了npm,然后安装了GRUNT,我收到了大量的JSHint错误(缺少分号、空格和制表符、额外的逗号等)。我知道这个项目是在另一个系统上进行的 错误描述: Running "jshint:beforeconcat" (jshint) task Linting js/filters/empFilter.js...ERROR [L22:C4] Missing semicolon. }]) angularjs文件出现错误 angular.module ("ap
Running "jshint:beforeconcat" (jshint) task
Linting js/filters/empFilter.js...ERROR
[L22:C4] Missing semicolon.
}])
angularjs文件出现错误
angular.module ("app").filter('empFilter', [function () {
return function (emps, username) {
/*some code*/
return emps;
};
}]) /* <--- error at this line */
grunfile.js中的JSHint选项
jshint: {
options: {
"globals": {
"asi": false,
"ga": true,
"FileReader": true,
"html2canvas": true,
"console": true,
"angular": true,
"$": true,
"window": true,
"screen": true,
"Image": true,
"clearTimeout": true,
"setTimeout": true,
"document": true,
"localStorage": true,
"sessionStorage": true,
"device": true,
"navigator": true,
"io": true,
"createjs": true,
"lib": true,
"platform": true,
"inherits": true,
"signals": true,
"Date": true
}
}
我不想根据错误更新文件,因为项目在另一个系统上运行正常。我在这里遗漏了什么吗?可能是另一个系统有一个
.jshintrc
文件,其中包含宽松的linting选项,可能这个文件没有添加到源代码管理中。可能是另一个系统有一个.jshintrc
文件,其中包含宽松的linting选项,可能这个文件没有添加到源代码管理中。可能另一个系统有一个.jshintrc
文件,其中包含宽松的linting选项,可能这个文件没有添加到源代码管理中。可能另一个系统有一个.jshintrc
文件,其中包含宽松的linting选项,也许这个文件没有添加到源代码管理中。您似乎没有理解jshint的要点。它会告诉您有脱毛错误。您粘贴的代码明显缺少一个。这不是关于代码是否有效,而是关于linting。那么你想怎么做呢?您可以修复错误、忽略错误或使jshint更轻松。您似乎没有抓住jshint的要点。它会告诉您有脱毛错误。您粘贴的代码明显缺少一个。这不是关于代码是否有效,而是关于linting。那么你想怎么做呢?您可以修复错误、忽略错误或使jshint更轻松。您似乎没有抓住jshint的要点。它会告诉您有脱毛错误。您粘贴的代码明显缺少一个。这不是关于代码是否有效,而是关于linting。那么你想怎么做呢?您可以修复错误、忽略错误或使jshint更轻松。您似乎没有抓住jshint的要点。它会告诉您有脱毛错误。您粘贴的代码明显缺少一个。这不是关于代码是否有效,而是关于linting。那么你想怎么做呢?您可以修复错误、忽略错误或使jshint更轻松。
jshint: {
options: {
"globals": {
"asi": false,
"ga": true,
"FileReader": true,
"html2canvas": true,
"console": true,
"angular": true,
"$": true,
"window": true,
"screen": true,
"Image": true,
"clearTimeout": true,
"setTimeout": true,
"document": true,
"localStorage": true,
"sessionStorage": true,
"device": true,
"navigator": true,
"io": true,
"createjs": true,
"lib": true,
"platform": true,
"inherits": true,
"signals": true,
"Date": true
}
}