How can I get ESLint to lint HTML files in VSCode?

后端 未结 3 1809
忘了有多久
忘了有多久 2021-02-13 00:33

I have a Javascript browser project split over multiple files and can\'t get ESLint to lint the script tags of my HTML file under the same global scope so that declarations and

3条回答
  •  广开言路
    2021-02-13 00:52

    I have this in /.vscode/settings.json

    {
      "eslint.validate": [ "javascript", "html" ]
    }
    

    I'm using an .eslintrc.js that looks like this

    module.exports = {
      "env": {
        "browser": true,
        "es6": true
      },
      "plugins": [
        "eslint-plugin-html",
      ],
      "extends": "eslint:recommended",
      "rules": {
      }
    };
    

    I have lots of rules defined but didn't paste them above

    Result:

提交回复
热议问题