Derek Chadwell
Derek Chadwell

Reputation: 715

eslint is running but not showing any lint errors/warnings

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?

Upvotes: 6

Views: 22023

Answers (2)

Derek Chadwell
Derek Chadwell

Reputation: 715

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"],
    

Upvotes: 3

CyclopeanCity
CyclopeanCity

Reputation: 91

You'll need to install an extension for VSCode to show lint errrors in the editor. Otherwise you can run eslint from the terminal to see its output. I use tslint so I don't know which extension to use but https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint might be what you're looking for.

Upvotes: 3

Related Questions