rondevera/jslintmate

Broken on OSX 10.8

Closed this issue · 7 comments

While it is nice to have everything pass through lint free... it is not very helpful. Every js file is passing through "lint free" on osx 10.8

Thanks for reporting this! I don't have access to 10.8 yet, but will release a fix as soon as I can.

jshint appears to work... but only using

die-antwort/jslintmate/

perhaps that will give you a good place to start. I've tested the homebrew and npm versions of jslint in the command line without a problem fwiw

Having the same problem. JSHint works fine but JSLint says everything is successful even with syntax errors in the file. Error trace is:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- jslintmate/lint_error (LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /Users/ryan.cannon/Library/Application Support/TextMate/Bundles/jslintmate.tmbundle/Support/lib/jslintmate.rb:38

Here's what I found while running jslint from the commandline:

shadow:~$ jsc "JavaScript JSLintMate.tmbundle/Support/lib/jslint.js" "JavaScript JSLintMate.tmbundle/Support/lib/jsc.js" -- "$(cat "jsfile.js")" --warn-about-unused-vars="true"

Exception: TypeError: Attempted to assign to readonly property.
ultimate@JavaScript JSLintMate.tmbundle/Support/lib/jslint.js:2553

Here's the offending method from the included jslint.js:

function ultimate(s) {
  var x = symbol(s, 0);
  x.from = 1;
  x.thru = 1;
  x.line = 0;
  x.edge = 'edge';
  s.string = s;
  return postscript(x);
}

Problematic line:
s.string = s,

An easy solution for this problem is to simply update jslint using this command:

curl -o ~/Library/Application Support/Avian/Bundles/JavaScript JSLintMate.tmbundle/Support/lib/jslint.js http://jslint.com/jslint.js

Replacing jslint.js has fixed the problem for me... perhaps the script for jshint should be updated as well. I could have sword I tried this earlier and it didn't work, but it works now and that is all that matters.

Thanks for looking into this! I've merged Bodnár's jslint.js update into the development branch, and also updated jshint.js on that branch. Please give it a shot and let me know how it goes!

For future reference, rather than modifying JSLintMate.tmbundle, you can also change your bundle settings to point to a custom build; take a look at the docs. These options let you work with the very latest JSLint/JSHint builds or your own custom builds.

JSLintMate 1.4 is now available for download, and has the latest versions of JSLint and JSHint. Please give it a try and let me know how it goes.