VS Code ESLint 检查快速修复...不起作用

问题描述 投票:0回答:2

我不确定这是否是最近的更新,但由于某种原因,我不再获得 ESLint 的快速修复。它会说“正在检查快速修复...”,但我不会显示任何内容。在 ESLint 服务器中,我可以看到可用的修复,但 VS Code 中缺少该命令。

Checking for quick fixes...

[Trace - 5:30:49 PM] Received response 'textDocument/codeAction - (13)' in 0ms.
Result: [
    {
        "title": "Disable no-unused-vars for this line",
        "command": {
            "title": "Disable no-unused-vars for this line",
            "command": "eslint.applyDisableLine",
            "arguments": [
                {
                    "uri": "file:///d%3A/Development/sfdx/insider/force-app/main/default/lwc/apexImperativeMethod/apexImperativeMethod.js",
                    "version": 14,
                    "ruleId": "no-unused-vars"
                }
            ]
        },
        "kind": "quickfix"
    },
    {
        "title": "Disable no-unused-vars for the entire file",
        "command": {
            "title": "Disable no-unused-vars for the entire file",
            "command": "eslint.applyDisableFile",
            "arguments": [
                {
                    "uri": "file:///",
                    "version": 14,
                    "ruleId": "no-unused-vars"
                }
            ]
        },
        "kind": "quickfix"
    },
    {
        "title": "Show documentation for no-unused-vars",
        "command": {
            "title": "Show documentation for no-unused-vars",
            "command": "eslint.openRuleDoc",
            "arguments": [
                {
                    "uri": "file:///",
                    "version": 14,
                    "ruleId": "no-unused-vars"
                }
            ]
        },
        "kind": "quickfix"
    }
]
visual-studio-code eslint
2个回答
0
投票

同样的事情也发生在我身上,在尝试了多种方法之后,对我有用的是重新安装代码,这意味着卸载代码,删除扩展文件夹并安装代码,然后安装扩展。快速修复又回来了。


0
投票

就我而言,Visual Studio Code 中的扩展之一需要重新启动。这就是 Angular 语言服务。所以我转到扩展 - 单击“重新启动”按钮,解决了问题。该按钮位于红色区域(参见屏幕截图):enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.