Closed andkirby closed 8 years ago
There is a problem with running JSHint via Rhino. https://github.com/jshint/jshint/issues/2308. I faced this problem which explained by link http://stackoverflow.com/questions/34581459/run-jshint-with-rhino-error-cannot-read-property-prototype-from-undefined
Finding JSHint config file priorities:
Default config (from PhpStorm):
{
"strict": true,
"noempty": true,
"noarg": true,
"eqeqeq": true,
"browser": true,
"bitwise": true,
"curly": true,
"undef": true,
"nonew": true,
"forin": true
}
Config:
<config>
<code>
<interpreter>
<nodejs>D:/s/nodejs/node.exe</nodejs>
</interpreter>
</code>
<validators>
<JsHint>
<execution>
<!--Path to executable file of JSHint file which should be interpreted by NodeJS-->
<jshint>D:/s/jshint/bin/jshint</jshint>
<command>%interpreter% --config=%config% %jshint%</command>
</execution>
<config>
<file>
<!--If you have .jshintrc or packages.json in your project root it will be set automatically by CommitHook-->
<!--Default configuration from PhpStorm-->
<default>src/config/jshint/phpstorm-default.json</default>
<!--Custom configuration file-->
<!--You may use variables PROJECT_DIR or HOME-->
<!--Relative path will be considered as a path in project-->
<custom/>
</file>
</config>
</JsHint>
</validators>
</config>
https://github.com/jshint/jshint/blob/master/examples/.jshintrc Config example.
Instruction https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-path-to-jshint
nodejs https://nodejs.org/en/
rhino https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Download_Rhino
jshint http://jshint.com/install/