vscode 底部状态栏不出现 eslint?

vscode setting.json

{
    "editor.wordWrap": "on",
    "workbench.colorTheme": "Dracula",
    "workbench.iconTheme": "material-icon-theme",
    "[html]": {
        "editor.defaultFormatter": "vscode.html-language-features"
    },
    "leetcode.endpoint": "leetcode-cn",
    "leetcode.workspaceFolder": "C:\\Users\\admin\\.leetcode",
    "leetcode.hint.configWebviewMarkdown": false,
    "z-reader.onlineSite": "起点",
    "[javascript]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "vetur.validation.template": false,
    "vetur.ignoreProjectWarning": true,
    "files.associations": {
        "*.cjson": "jsonc",
        "*.wxss": "css",
        "*.wxs": "javascript"
    },
    "emmet.includeLanguages": {
        "wxml": "html",
        "javascript": "javascriptreact"
    },
    "minapp-vscode.disableAutoConfig": true,
    "[json]": {
        "editor.quickSuggestions": {
            "strings": true
        },
        "editor.suggest.insertMode": "replace",
        "gitlens.codeLens.scopes": [
            "document"
        ],
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "eslint.codeAction.showDocumentation": {
        "enable": true
    }, //  启用保存时自动修复,默认只支持.js文件
    "eslint.validate": [
        "javascript", //  用eslint的规则检测js文件
        "javascriptreact",
        "html",
        "vue"
    ],
    "window.zoomLevel": 2,
    "window.title": "${dirty}${activeEditorLong}${separator}${rootName}${separator}${appName}",
    "liveServer.settings.CustomBrowser": "chrome",
    "liveServer.settings.host": "xxxxxxxxx",
    "liveServer.settings.port": 8888,
    "open-in-browser.default": "Chrome",
    "[css]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "[jsonc]": {
        "editor.defaultFormatter": "vscode.json-language-features"
    },
    "workbench.colorCustomizations": {},
    "editor.language.brackets": [],
    "eslint.codeActionsOnSave.rules": null,
    "eslint.execArgv": null,
    "typescript.disableAutomaticTypeAcquisition": true,
    "emmet.preferences": {},
    "[scss]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "[vue]": {
        "editor.defaultFormatter": "octref.vetur"
    },
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
    "eslint.format.enable": true,
}

.eslintrc.js

module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: [
    'plugin:vue/essential'
    // 关闭ESlint关键代码
    // '@vue/standard'
  ],
  parserOptions: {
    parser: 'babel-eslint'
  },
  rules: {
    // 严格的检查缩进问题,不是报错,我们可以关闭这个检查规则,然后在终端输入npm run dev
    indent: ['off', 2],
    // 使用eslint时,严格模式下,报错Missing space before function parentheses的问题,意思是在方法名和刮号之间需要有一格空格。
    'space-before-function-paren': 0,
    'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    // 关闭prettier
    'prettier/prettier': 'off',
    "vue/comment-directive": 'off' // 解决index.html 中红线
  }
}

eslintignore

/dist/
/node_modules/

eslint 也安装了,为什么不生效呢?底下没有看到eslint 的标
image.png

image.png

阅读 6.4k
1 个回答

打开vscode的输出窗口, 切换到扩展宿主 看看什么错误 再对症下药

image.png

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题