Enabling JSHint Support for Ext.js in Intellij Idea

折月煮酒 提交于 2019-12-10 11:02:03

问题


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?

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

SOLUTION:

@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"
    ]
}

Second set intellij to use the .jshintrc file:

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.

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


回答1:


You can do the following in your jshint.rc

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


来源:https://stackoverflow.com/questions/24880843/enabling-jshint-support-for-ext-js-in-intellij-idea

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!