pyriand3r
pyriand3r

Reputation: 797

Enabling JSHint Support for Ext.js in Intellij Idea

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.

Upvotes: 2

Views: 1550

Answers (1)

Nikos
Nikos

Reputation: 7551

You can do the following in your jshint.rc

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

Upvotes: 2

Related Questions