Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tag: 0.7
Fetching contributors…

Cannot retrieve contributors at this time

65 lines (53 sloc) 2.14 kB
;;; flymake-jslint.el --- A flymake handler for javascript using jslint
;;; Author: Steve Purcell <>
;;; Homepage:
;;; Version: DEV
;;; Package-Requires: ((flymake-easy "0.1"))
;;; Commentary:
;; References:
;; Usage:
;; (require 'flymake-jslint)
;; (add-hook 'js-mode-hook 'flymake-jslint-load)
;; Uses flymake-easy, from
;;; Code:
(require 'flymake-easy)
(defgroup flymake-jslint nil
"Flymake checking of Javascript using jslint"
:group 'programming
:prefix "flymake-jslint-")
(defcustom flymake-jslint-detect-trailing-comma t
"Whether or not to report warnings about trailing commas."
:type 'boolean :group :flymake-jslint)
(defcustom flymake-jslint-command "jsl"
"Name (and optionally full path) of jslint executable."
:type 'string :group 'flymake-jslint)
(defvar flymake-jslint-err-line-patterns
'(("^\\(.+\\)\:\\([0-9]+\\)\: \\(SyntaxError\:.+\\)\:$" nil 2 nil 3)
("^\\(.+\\)(\\([0-9]+\\)): \\(SyntaxError:.+\\)$" nil 2 nil 3)
("^\\(.+\\)(\\([0-9]+\\)): \\(lint \\)?\\(warning:.+\\)$" nil 2 nil 4)))
(defvar flymake-jslint-trailing-comma-err-line-pattern
'("^\\(.+\\)\:\\([0-9]+\\)\: strict \\(warning: trailing comma.+\\)\:$" nil 2 nil 3))
(defun flymake-jslint-command (filename)
"Construct a command that flymake can use to check javascript source."
(list flymake-jslint-command "-process" filename))
(defun flymake-jslint-load ()
"Configure flymake mode to check the current buffer's javascript syntax."
(flymake-easy-load 'flymake-jslint-command
(append flymake-jslint-err-line-patterns
(when flymake-jslint-detect-trailing-comma
(list flymake-jslint-trailing-comma-err-line-pattern)))
(provide 'flymake-js)
;;; flymake-jslint.el ends here
Jump to Line
Something went wrong with that request. Please try again.