设置lintnode

时间:2013-01-24 17:26:40

标签: node.js emacs elisp npm

所以,我正在尝试设置lintnode以使用emacs,它似乎安装得很好。我启动时在缓冲区或其他任何地方都没有出错。

然而,当我去写一些JS时,我没有得到任何功能。所以我检查npm以查看所有节点包是否都是最新的,它们不是,但即使在我执行'npm update'并获得200个响应后,版本仍然保持不变。我正在运行Xubuntu以获得一些背景信息。

这是我的emacs初始文件的副本,以查看您是否认为这可能是问题。

如果这太乱了,这是一个粘贴垃圾箱。 Emacs Init

(add-to-list 'load-path "~/.emacs.d/auto-complete-1.3.1")
;Load the default configuration
(require 'auto-complete-config)
;Make sure we can find the dictionaries
(add-to-list 'ac-dictionary-directories "~/.emacs.d/auto-complete-1.3.1/dict")
;Use dictionaries by default
(setq-default ac-sources (add-to-list 'ac-sources 'ac-source-dictionary))
(global-auto-complete-mode t)
;Start auto completion after two characters of a word
(setq ac-auto-start 2)
; case sensitivity is important when finding matches
(setq ac-ignore-case nil)

(add-hook 'js-mode-hook'
  (lambda ()
    ;;Scan the file for nested code blocks
    (imenu-add-menubar-index)
    ;;Activate folding mode
    (hs-minor-mode t)
    )
)

;;Yasnipped: Auto-codesnippet manager
(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet")
(require 'yasnippet)
(yas-global-mode 1)

;;Lintnode
(add-to-list 'load-path "~/.emacs.d/plugins/lintnode")
(require 'flymake-jslint)
(add-hook 'javascript-mode-hook
  (lambda () (flymake-mode t)))
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(lintnode-autostart t))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )

;;Flymake-the nice minibuffer cursor linked message
(add-to-list 'load-path "~/.emacs.d/plugins/flymake")
(require 'flymake-cursor)

2 个答案:

答案 0 :(得分:1)

js-mode-hook末尾有一个额外的引用。 问题的根源可能是您以后使用不存在的javascript-mode-hook AFAIK(javascript-modejs-mode的别名,因此该钩子称为js-mode-hook)。

答案 1 :(得分:0)

这有使用lintnode安装ESLint的正确说明。 http://emacswiki.org/emacs/FlymakeJavaScript