js2-mode中的Linting错误似乎*不是来自flycheck?

时间:2016-10-20 15:56:31

标签: javascript emacs spacemacs flycheck

我正在使用带有Spacemacs配置的emacs(启用了javascript图层,语法检查未启用)。在js2模式下,我发现错误的linting正在发生(即我的项目根目录中有一个.eslintrc文件并且其配置被忽略 - 从cli运行eslint给出零错误但错误出现在 - 缓冲液)。

eslint from the cli shows no errors

此时 甚至可能产生这些linting错误,我有点不知所措。据我所知,他们必须来自flycheck(我在javascript层代码中注意this line,即使文档中没有提到flycheck,也无法找到它所调用的位置)。但是,我可以发誓,flycheck没有开启。我很确定这是因为

  • 我尝试通过交互式迷你缓冲区手动切换flycheck-mode
  • 我已经运行describe-mode并确保没有提及flycheck,linting或语法检查
  • 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 )

1 个答案:

答案 0 :(得分:4)

这些错误直接来自js2-mode

您可以通过在配置中设置这两个来关闭它们:

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