Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

emacs integration

2007-08-02
2013-05-28
  • Hi,

      To integrate jsl to emacs just add the following to your emcas init file (~/.emacs).
      It assumes you are using a javascript-mode with a hook support. I use Karl Landström's mode.
    http://web.comhem.se/~u34308910/emacs.html#javascript

      just press 'F8' and it will execute jsl in the current buffer.

    ;; javascript lint
    (defun jslint-thisfile ()
      (interactive)
      (compile (format "jsl -process %s" (buffer-file-name))))

    (add-hook 'javascript-mode-hook
          '(lambda ()
          (local-set-key [f8] 'jslint-thisfile)))

    ==================

      I guess this is a useful information to be added to the homepage.

    One question.
    Can I pass configuration options as arguments to the command line instead of using a config file?
    i would like do something like:
      jsl +missing_option_explicit -process file.js

    cheers,
      Eduardo

     
    • Martin Harper
      Martin Harper
      2007-08-02

      > Can I pass configuration options as arguments to the command line instead of using a config file?
      > I would like do something like:
      > jsl +missing_option_explicit -process file.js

      I achieve the same result by using multiple config files. My "strict" Javascript Lint macro is invoked as follows:

      -conf C:\blah\jsl.ide-strict.conf -process $(ItemPath)

       
    •   Thanks for the reply Martin.
        But this is exactly what I am trying to avoid. The use of a config file just to pass one parameter.

       
    • This has (finally!) been added to the docs page:
      http://www.javascriptlint.com/docs/running_from_your_ide.htm

      Thanks Eduardo!

      -Matthias