Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
JSHint integrated into emacs
tree: 54e4fbd338

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
LICENSE
README.markdown
example.png
flymake-jshint.el
jshint-emacs.js
jshint-mode-pkg.el
jshint-mode.js
jshint.js
jslint.js
package.json

README.markdown

jshint-mode

Integrate JSHint into Emacs via a node.js server.

example

jshint-mode was heavily inspired by Kevin Turners lintnode.

Dependencies

Install formidable via npm:

$ npm install formidable

Building

Install via npm

$ npm install jshint-mode

or you can download or clone

$ git clone git://github.com/daleharvey/jshint-mode.git

Usage

Add the configuration to your .emacs config file:

$jshint-emacs-path >> ~/.emacs  // or
$npm explore jshint-mode
Exploring /Users/yourname/node_modules/jshint-mode
Type 'exit' or ^D when finished

bash-3.2$ exit

or if you downloaded manually:

(add-to-list 'load-path "~/path/to/jshint-mode")
(require 'flymake-jshint)
(add-hook 'javascript-mode-hook
     (lambda () (flymake-mode t)))

Becareful: If you emacs can't find node program, maybe you should add some config to .emacs like this:

(setenv "PATH" (concat "/usr/local/bin:" (getenv "PATH")))
(setq exec-path
      '(
    "/usr/local/bin"
    "/usr/bin"
    ))

You can use M-x flymake-mode to turn flymake of and on, if you want to turn it on be fault, add the following to your .emacs

;; Turns on flymake for all files which have a flymake mode
(add-hook 'find-file-hook 'flymake-find-file-hook)

Note to Emacs.app users

If use Emacs.app on OS X, you need to set the following environment variables:

  • PATH - Add path to your node executable
  • NODE_PATH - Add path to where your node_modules are located so node can find the formidable module
Something went wrong with that request. Please try again.