2016-10-20 22 views
0

我使用emacs與Spacemacs配置(啓用javascript層,語法檢查而不是啓用)。在js2模式下,我發現錯誤的linting正在發生(即我的項目根目錄中有一個.eslintrc文件,並且它的配置被忽略 - 從cli運行eslint給我零錯誤,但錯誤出現在緩衝區中)。js2模式下的linting錯誤似乎不是來自flycheck?

eslint from the cli shows no errors

我在什麼甚至可以產生這些錯誤掉毛位在在這一點上的損失。據我所知,他們必須來自flycheck(我注意到在javascript層代碼中的this line,即使flycheck沒有在文檔中提及,也不能找到它從哪裏調用)。不過,我可以發誓flycheck不在。我確信這一點,因爲

  • 我已經試過手動切換關閉flycheck-mode通過互動小緩衝區
  • 我已經運行describe-mode,並確保有flycheck隻字不提,掉毛,或語法檢查
  • flycheck-verify-setup報告Flycheck Mode is disabled.
  • 我添加了一個鉤子(add-hook 'flycheck-mode-hook (lambda() (message "entered flycheck mode")))從未被觸發

那麼,合作這些錯誤在我的緩衝區可能來自?

Eslint errors about missing semi colon and trailing comma

Errors show up in minibuffer

這裏是一個.spacemacs摘錄

dotspacemacs-configuration-layers 
'(
    ;; ---------------------------------------------------------------- 
    ;; Example of useful layers you may want to use right away. 
    ;; Uncomment some layer names and press <SPC f e R> (Vim style) or 
    ;; <M-m f e R> (Emacs style) to install them. 
    ;; ---------------------------------------------------------------- 
    javascript 
    html 
    helm 
    auto-completion 
    git 
    better-defaults 
    colors 
    ;; emacs-lisp 
    markdown 
    clojure 
    ;; org 
    ;; (shell :variables shell-default-position 'bottom) 
    ;; spell-checking 
    ;; react 
    ;; syntax-checking 
     version-control 
    ) 
;; List of additional packages that will be installed without being 
;; wrapped in a layer. If you need some configuration for these 
;; packages, then consider creating a layer. You can also put the 
;; configuration in `dotspacemacs/user-config'. 
dotspacemacs-additional-packages '(
                     paredit 
                     editorconfig 
                     writeroom-mode 
                     tide 
                     csharp-mode 
                     elisp-format 
                     ;; powershell 
                     omnisharp 
                     gist 
                     parinfer 
                     ag) 
+0

你能提供實際的錯誤:

你可以在你的配置設置這些2關閉它們? –

+0

@AronGriffis你是什麼意思?他們在我的js文件中發現錯誤。當我在'.eslintrc'中禁用了該規則並且cli(正確)不報告它時,就像「沒有分號」。沒有Emacs錯誤 –

回答

4

這些錯誤直接來自js2-mode

(setq js2-mode-show-parse-errors nil 
     js2-mode-show-strict-warnings nil)