carolineartz
3/6/2014 - 2:03 AM

install JavaScript tools for Sublime

install JavaScript tools for Sublime

Install JavaScript console in Sublime (Node build system)

  1. Node must be installed
  2. In Sublime, navigate to Tools --> Build System --> New Build System...
  3. Replace any text with
{
  "cmd": ["/usr/local/bin/node", "$file", "$file_base_name"],
  "working_dir": "${project_path:${folder}}",
  "selector": "*.js"
}

where "/usr/local/bin/node" is the path to your node executable

  1. Save the file as Node.sublime-build in the default directory
  2. Restart Sublime
  3. Navigate toTools --> Build System and select Node
  4. Test functionality: open a .js file (e.g., our gradebook.js) and hit command (or ctrl) + B. The console should pop up at the bottom on the Sublime window with the output.

source see article comments if getting Error2

Install jsHint

  1. Install Sublime Package Control for your Sublime version (if not already installed)

  2. Install SublimeLinter via Package Control (if not already installed)

  3. Install jshint globally (-g) on your machine via terminal (must have node already installed).

  npm install -g jshint
  1. Install SublimeLinter-jsHint via Package Control in Sublime

Note: you can install linters for pretty much any language now that the main SublimeLinter package manager installed. Here is a list of available linters. Most, like the Ruby linter (rubocop) need the executable installed first similar to the JavaScript one. For Ruby, its just gem install rubocop in terminal before installing SublimeLinter-rubocop via Package Control. For CSS, SublimeLinter-csslint, it's npm install -g csslint. All the linter-specific requirements can be found on the respective Package Control page.