Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/386.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用现有的Grunt项目-获取JSHint缺少分号和错误_Javascript_Node.js_Angularjs_Gruntjs_Jshint - Fatal编程技术网

Javascript 使用现有的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

在一个现有的GRUNT项目()中,我安装了npm,然后安装了GRUNT,我收到了大量的JSHint错误(缺少分号、空格和制表符、额外的逗号等)。我知道这个项目是在另一个系统上进行的

错误描述:

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
                }
            }