问题
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