【问题标题】:Linting errors in js2-mode that seem to *not* be coming from flycheck?js2 模式中的 Linting 错误似乎*不是*来自 flycheck?
【发布时间】:2016-10-21 08:22:20
【问题描述】:

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

此时我有点不知所措,什么 甚至可能会产生这些 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")))

那么我缓冲区中的这些错误可能来自哪里?

这是.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 )

【问题讨论】:

  • 你能提供实际的错误吗?
  • @AronGriffis 你是什么意思?他们在我的 js 文件中检查错误。当我在.eslintrc 中禁用了该规则并且cli(正确)没有报告它时,诸如“没有分号”之类的东西。没有 Emacs 错误

标签: javascript emacs spacemacs flycheck


【解决方案1】:

这些错误直接来自js2-mode

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-08-16
    • 2016-01-21
    • 2021-11-07
    • 1970-01-01
    • 1970-01-01
    • 2016-04-06
    • 2023-03-09
    相关资源
    最近更新 更多