{"action":"created","issue":{"url":"https://api.github.com/repos/jshint/jshint/issues/2442","labels_url":"https://api.github.com/repos/jshint/jshint/issues/2442/labels{/name}","comments_url":"https://api.github.com/repos/jshint/jshint/issues/2442/comments","events_url":"https://api.github.com/repos/jshint/jshint/issues/2442/events","html_url":"https://github.com/jshint/jshint/issues/2442","id":84741674,"number":2442,"title":"How to run jshint.js with node.exe and get output?","user":{"login":"AlbertWiersch","id":7662186,"avatar_url":"https://avatars.githubusercontent.com/u/7662186?v=3","gravatar_id":"","url":"https://api.github.com/users/AlbertWiersch","html_url":"https://github.com/AlbertWiersch","followers_url":"https://api.github.com/users/AlbertWiersch/followers","following_url":"https://api.github.com/users/AlbertWiersch/following{/other_user}","gists_url":"https://api.github.com/users/AlbertWiersch/gists{/gist_id}","starred_url":"https://api.github.com/users/AlbertWiersch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlbertWiersch/subscriptions","organizations_url":"https://api.github.com/users/AlbertWiersch/orgs","repos_url":"https://api.github.com/users/AlbertWiersch/repos","events_url":"https://api.github.com/users/AlbertWiersch/events{/privacy}","received_events_url":"https://api.github.com/users/AlbertWiersch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-03T19:47:03Z","updated_at":"2015-06-11T22:49:00Z","closed_at":null,"body":"I'm the developer of CSE HTML Validator for Windows. CSE HTML Validator currently uses JSLint and runs JSLint with something like\r\nnode.exe wrapper.js test.js\r\n\r\nThe wrapper.js uses jslint.js (in the same folder as wrapper.js) to generate the results and output them to the console. The setup program for CSE HTML Validator only has to install node.exe, wrapper.js, and jslint.js on a user's system to get it to work.\r\n\r\nI want to be able to support jshint in a similar manner.\r\n \r\nI see there is a large “jshint.js” file in the dist folder here:\r\nhttps://github.com/jshint/jshint/tree/master/dist\r\n \r\nI’m hoping I can simply distribute just that file (jshint.js) with CSE HTML Validator (similar to JSLint), and call jshint.js with node.exe and the name of the file to check. I am already installing node.exe on the user’s system to support JSLint.\r\n \r\nSo basically what I would like to know is what files I need (the minimum number) to install on the user’s system (when they install my application) and how to call JSHint (I am already installing node.exe for JSLint). I hope to find a way to only install jshint.js and maybe a support file (like wrapper.js which I use for JSLint), and be able to execute something like “node.exe jshint.js test.js” and get the results in a similar way to JSLint.\r\n \r\nHopefully I won’t have to install all the JSHint files in the “src” folder or any modules folder or npm or a bunch of other files.\r\n \r\nPerhaps I only need an appropriate wrapper.js file for jshint? However, I'm not totally sure and would like some help from someone who knows a lot about jshint.\r\n\r\nCan someone help me get this working this way? I would really appreciate any help. I want to make jshint the default JavaScript linter instead of jslint because I think it's more practical and better overall.\r\n"},"comment":{"url":"https://api.github.com/repos/jshint/jshint/issues/comments/111297937","html_url":"https://github.com/jshint/jshint/issues/2442#issuecomment-111297937","issue_url":"https://api.github.com/repos/jshint/jshint/issues/2442","id":111297937,"user":{"login":"AlbertWiersch","id":7662186,"avatar_url":"https://avatars.githubusercontent.com/u/7662186?v=3","gravatar_id":"","url":"https://api.github.com/users/AlbertWiersch","html_url":"https://github.com/AlbertWiersch","followers_url":"https://api.github.com/users/AlbertWiersch/followers","following_url":"https://api.github.com/users/AlbertWiersch/following{/other_user}","gists_url":"https://api.github.com/users/AlbertWiersch/gists{/gist_id}","starred_url":"https://api.github.com/users/AlbertWiersch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlbertWiersch/subscriptions","organizations_url":"https://api.github.com/users/AlbertWiersch/orgs","repos_url":"https://api.github.com/users/AlbertWiersch/repos","events_url":"https://api.github.com/users/AlbertWiersch/events{/privacy}","received_events_url":"https://api.github.com/users/AlbertWiersch/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T22:49:00Z","updated_at":"2015-06-11T22:49:00Z","body":"That's what I was hoping for but it's not working.\r\n\r\nFor example, this is what I get when I run \"node.exe wrapper.js test.js\":\r\n\r\nT:\\JSHint>node.exe wrapper.js test.js\r\nevalmachine.<anonymous>:2194\r\n    var arrayProto = Array.prototype,\r\n                          ^\r\nTypeError: Cannot read property 'prototype' of undefined\r\n    at runInContext (evalmachine.<anonymous>:2194:27)\r\n    at Object.<anonymous> (evalmachine.<anonymous>:13258:11)\r\n    at Object.<anonymous> (evalmachine.<anonymous>:13289:3)\r\n    at Object.require (evalmachine.<anonymous>:13291:4)\r\n    at s (evalmachine.<anonymous>:6:262)\r\n    at evalmachine.<anonymous>:6:313\r\n    at Object.require.jshint../lex.js (evalmachine.<anonymous>:17432:16)\r\n    at s (evalmachine.<anonymous>:6:262)\r\n    at evalmachine.<anonymous>:23042:10\r\n    at evalmachine.<anonymous>:23044:2\r\n\r\n\r\nIf someone who knows more about this can help, I'd much appreciate it. If you extract the files here into a 'JSHint' folder, then you will probably be able to reproduce this if node.exe is in your path:\r\nhttps://www.htmlvalidator.com/private/JSHint.zip\r\n\r\nPerhaps this is a bug in jshint.js?"}}