+2

JavaScript Compiler

Tiago Duarte 12 років тому оновлений 12 років тому 5

Till this day I have not found an editor that will compile JavaScript code.
I'm left with jshint, http://www.jshint.com/.


I would be great to have this on Sublime Text.


Thanks.

JavaScript, like JQuery, is unexpectedly getting more usage over the time.
When you develop on a programming language, you have one-click validation of your code, such as grammatical or orthographical errors, mostly stuff that you know right away your code won't work (non-existing functions, non-declared variables, missing semicolon). JSHint, Firebug and IEDeveloperToolbar do this, but only on runtime, and there should be a module on IDE tools that known how to "compile" or check for errors within JavaScript, at least, as far as possible.

The idea is, as in other languages, being able to test our code on the editor tool, without actually saving, opening the browser, and navigating through the site each time a change is made.


JSHint is pretty close to that.

"JSHint is a tool to detect errors and potential problems in JavaScript code."


That's not really "compiling", it's merely linting. There's a good package called SublimeLinter which will do as-you-type linting for a range of different languages, including Javascript (using JSHint) https://github.com/Kronuz/SublimeLinter

looks like exactly what I need
now I just have to figure out how to get it working and if it tells us which errors there are and if uncompresses the js like http://jsbeautifier.org/