install JavaScript tools for Sublime
Tools --> Build System --> New Build System...
{
"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
Node.sublime-build
in the default directoryTools --> Build System
and select Node
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 Sublime Package Control for your Sublime version (if not already installed)
Install SublimeLinter via Package Control (if not already installed)
Install jshint globally (-g
) on your machine via terminal (must have node already installed).
npm install -g jshint
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.