【问题标题】:Set path for linter in setting.json [vscode]在 setting.json [vscode] 中设置 linter 的路径
【发布时间】:2021-02-23 13:23:59
【问题描述】:

我在 .vscode 文件夹中有以下 setting.json 文件,

{
    "cSpell.ignoreWords": [
        "pformat"
    ]
}

我的 eslint 插件出现问题,在 vscode 中出现以下错误,

[Info  - 13:14:45] Failed to load plugin 'react-hooks' declared in 'projectmt'/.eslintrc.json': Cannot find module 'eslint-plugin-react-hooks'

为了解决这个问题,我需要添加一些东西来指定项目中 linting 文件的路径,但我被告知但没有显示如何做到这一点。

【问题讨论】:

    标签: visual-studio-code eslint vscode-settings


    【解决方案1】:

    所以我自己设法解决了这个问题,

    你需要在 settings.json 中指定 eslint.json 文件所在的位置。代码是

        "eslint.workingDirectories": [
        "./projectmt/"
    ] 
    

    这让我的 linter 再次在 vscode 中工作,希望这对将来的某人有所帮助。

    【讨论】:

      猜你喜欢
      • 2020-05-18
      • 1970-01-01
      • 2018-08-17
      • 2020-07-21
      • 1970-01-01
      • 2016-07-19
      • 1970-01-01
      • 2021-11-02
      • 2020-11-30
      相关资源
      最近更新 更多