Enabling JSHint Support for Ext.js in Intellij Ide

2019-05-28 10:10发布

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条回答
疯言疯语
2楼-- · 2019-05-28 10:48

You can do the following in your jshint.rc

 "jshint_options":
    {
        "globals": {
            "Ext": false
        }
     }
查看更多
登录 后发表回答