问题标签 [grunt-contrib-jshint]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
274 浏览

angularjs - JSHint 无法找到/解释 .jshintrc 文件

我正在使用WebStorm IDE并创建了我的 angularJS 项目。我也在使用grunt,并且正在使用grunt-contrib-jshint。我在我的.jshintrc文件中预配置了一些选项,这些选项已经在我用来创建项目的angular-seed存储库中:

当我grunt jshint在终端上运行时,我得到了很多错误,所有这些错误都与选项设置不正确时出现的错误有关。但是,当我复制这些选项并将它们放入我Gruntfile的 .

基本上,我所理解的jshint不是从.jshintrc文件中读取选项。我该如何解决这个问题?

0 投票
5 回答
32968 浏览

javascript - 箭头函数语法 (=>)' 仅在 ES6 中可用(使用 'esversion: 6')

目前我正在使用量角器/咕噜声运行我的测试,但我收到以下错误消息:

我认为我的.jshintrc文件没有被读取,因为我已经添加了这个条件。

.jshintrc

Gruntfile.js

有什么想法可以解决这个问题吗?

0 投票
1 回答
178 浏览

gruntjs - grunt jshint 配置不起作用

为 grunt 设置 jshint 选项时遇到问题

这是我的 gruntfile.js

仍然收到错误

71 | 返回 (this.optional(element) && value=="") || 重新测试(值);^ 使用 '===' 与 '' 进行比较。

感谢您的帮助

0 投票
1 回答
30 浏览

grunt-contrib-jshint - grunt-contrib-jshint 不显示消息

我创建了一个新节点项目,我安装了很多模块并创建了第一个 index.js 文件

包.json

index.js(失败了,因为我想看到 jshint 消息!)

如果我从我看到的项目文件夹中发送 cmd jshint index.js(工作正常):

现在我想使用 grunt 任务来检查我的文件

Gruntfile.js

现在我尝试使用带有命令 grunt jshint 的单任务 jshint,但没有看到任何消息。如果我使用手表,则仅在第一次和之后不检查文件 index.js 上的任何更改后观看任务。

我不明白为什么直接命令 jshint 工作,但任务 grunt 保持冻结

0 投票
1 回答
1512 浏览

javascript - jshint 'esversion: 6' 问题

我在运行 jshint 任务时遇到问题。它提醒我将 esversion: 6 添加到我的 .jshintrc 文件中。我是这样输入的:

当那不起作用时,我尝试像这样内联添加它:

但是,它仍然抛出相同的错误。有没有其他人经历过这个?

0 投票
1 回答
34 浏览

protractor - failed reason or exception is not getting displayed when working with Protractor Cucumber

i am trying to work with protractor-cucumber framework and when i executing the script.. even though the script is fine still script is failing and it is not giving the failure reason or exception

Same thing is working fine with Jasmine but when it comes to protractor-cucumber it is working like this

My Config File

My Spec file

When i executing the script it is opening the chrome browser and loading the url also but don't know why it is getting failed and it is not even giving the result of the test

Execution Result

And I'm using the grunt file for execution..

so someone please help me to come out from this issue

0 投票
0 回答
30 浏览

javascript - grunt 正在更改 Protractor 配置文件中定义的文件的路径

我正在将我的量角器测试集成到 grunt 中,并且我面临着 grunt 的不同情况。当 grunt 运行我的配置文件时,它正在通过更改位置来搜索文件。

例如:

我的文件位置我提到了 TestData 文件的路径,例如

c:/workspace/ProjectName/TestData/filename.ext

所以我写在我的配置文件中

../../TestData/file.extn运行配置文件时它按预期工作

但是当使用 grunt 运行时,它使用相同的路径搜索,例如

C:/TestData/file.extn 表示它正在跳过 2 个文件夹,并开始从 grunt 文件位置搜索文件。

有人可以帮助我吗?

0 投票
0 回答
79 浏览

javascript - jsHint 识别?运算符作为错误

有没有人成功获得新的?Javascript中的运算符传递jsHint?我已经用 esversion: 6 设置了我的项目,但我仍然遇到多个错误。jsHint 似乎认为它是一个不正确的三元运算符。我知道我可以让 jsHint 忽略该行,但如果我每次使用运算符时都不必这样做,我会更喜欢。