eslint is running but not showing any lint errors/warnings

Derek Chadwell picture Derek Chadwell · Mar 1, 2019 · Viewed 10k times · Source

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

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.

How do I debug this?

Answer

Derek Chadwell picture Derek Chadwell · Mar 4, 2019

I needed to

  1. install eslint-plugin-vue

  2. add the following to settings.json in vscode

    "eslint.validate": [
        {
          "language": "vue",
          "autoFix": true
        },
        {
          "language": "html",
          "autoFix": true
        },
        {
          "language": "javascript",
          "autoFix": true
        }
    
  3. and update .eslintrc to include

    "globals: "Vue" : true,"
    

    and

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

    in addition to

    "plugins": ["html"],