首页 文章

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

提问于
浏览
0

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

eslint from the cli shows no errors

在这一点上我甚至有点不知所措,甚至可能产生这些掉毛错误 . 据我所知,他们必须来自flycheck(我在javascript层代码中注意this line,即使flycheck不是't mentioned in the docs nor can I find where its invoked from). However, I can swear that flycheck isn' t . 我很确定这是因为

  • 我尝试通过交互式迷你缓冲区手动切换 flycheck-mode

  • 我已经运行 describe-mode 并确保没有提及flycheck,linting或语法检查

  • flycheck-verify-setup reports 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 回答

  • 4

    这些错误直接来自 js2-mode .

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

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

相关问题