在Intellij Idea中启用JSHint对Ext.js的支持 [英] Enabling JSHint Support for Ext.js in Intellij Idea

查看:769
本文介绍了在Intellij Idea中启用JSHint对Ext.js的支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,当我使用JSHint进行我的Ext.js项目时,每次我使用 Ext 它被标记为'Ext'没有定义由JSHint。我如何禁止此警告或将Ext.js集成到JSHint?

So, when i'm using JSHint for my Ext.js project everytime i use Ext it is marked as 'Ext' is not defined by JSHint. How do i suppress this warning or integrate Ext.js into JSHint?

我将Ext源作为外部库和代码完成工作集成到我的项目中,因此Intellij知道关于Ext。

I have integrated the Ext sources into my project as an external library and code completion works, so Intellij knows about Ext.

解决方案:

@Nikos回答和jshint文档给了我正确的方向。我在项目的根目录中放置了一个名为 .jshintrc 的文件。内容:

@Nikos answer and the jshint documentation gave me the right direction. I have placed a file called .jshintrc in the root directory of my project. Content:

{
    "predef": [
        "Ext",
        "Ext5"
    ]
}

第二套intellij使用 .jshintrc file:

Second set intellij to use the .jshintrc file:

在设置 - >语言和框架 - > Javascript - >代码质量工具 - > JSHint检查右上角的框使用配置文件并选择第一个条目默认来触发intellij使用您的配置文件而不是内部配置。

In settings -> Languages & Frameworks ->Javascript -> Code Quality Tools -> JSHint check the box on top right Use config file and choose the first entry "Default" to trigger intellij to use your config file instead of the internal configuration.

现在一切正常。请注意,您必须将所有其他jshint配置放在 .jshintrc 文件内。

Now everything's working. Note that you have to place all additional jshint configuration now inside of the .jshintrc file.

推荐答案

您可以在jshint.rc中执行以下操作:

You can do the following in your jshint.rc

 "jshint_options":
    {
        "globals": {
            "Ext": false
        }
     }

这篇关于在Intellij Idea中启用JSHint对Ext.js的支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆