eslint正在运行,但未显示任何皮棉错误/警告 [英] eslint is running but not showing any lint errors/warnings

查看:989
本文介绍了eslint正在运行,但未显示任何皮棉错误/警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将vscode与eslint一起使用. eslint控制台显示以下内容:

I am using vscode with eslint. The eslint console shows the following:

[Info  - 3:31:14 PM] ESLint server stopped.
[Info  - 3:31:14 PM] ESLint server running in node v10.2.0
[Info  - 3:31:14 PM] ESLint server is running.
[Info  - 3:31:15 PM] ESLint library loaded from: 
/usr/local/lib/node_modules/eslint/lib/api.js

因此eslint似乎正在加载并正在运行.但是,我的项目根目录中有一个.eslintrc文件,其中包含规则,而vscode却没有显示任何掉毛错误.

So eslint appears to be loading and running. However, there is a .eslintrc file in my project root that has rules and vscode is not showing me any linting errors.

我该如何调试?

推荐答案

我需要

  1. 安装eslint-plugin-vue

将以下内容添加到vscode中的settings.json中

add the following to settings.json in vscode

"eslint.validate": [
    {
      "language": "vue",
      "autoFix": true
    },
    {
      "language": "html",
      "autoFix": true
    },
    {
      "language": "javascript",
      "autoFix": true
    }

  • 并更新.eslintrc以使其包含

  • and update .eslintrc to include

    "globals: "Vue" : true,"
    

    "extends": [
        "eslint:recommended",
        "plugin:vue/recommended"
    ],
    

    除了

    "plugins": ["html"],
    

  • 这篇关于eslint正在运行,但未显示任何皮棉错误/警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆