【问题标题】:How to fix the ESLint expected indentation of N spaces but found Y issue?如何修复 ESLint 预期的 N 个空格缩进但发现 Y 问题?
【发布时间】:2020-07-11 01:34:46
【问题描述】:

我从 git 存储库安装了一个 React.js 项目,但是当我尝试通过创建新行或复制/粘贴一段代码来修改任何代码时,我的 IDE (PhpStorm) 给了我以下错误:

ESLint expected indentation of 2 spaces but found 4

更多信息:

  1. IDE:PhpStorm
  2. 操作系统:Windows 10
  3. 此项目是在 Linux 中开发的

【问题讨论】:

    标签: intellij-idea phpstorm eslint


    【解决方案1】:

    请尝试按照https://www.jetbrains.com/help/phpstorm/2019.3/eslint.html#ws_js_linters_eslint_import_code_style_from_eslint 处的说明从 ESLint 配置中导入代码样式首选项,然后使用 代码 | 重新格式化代码。重新格式化代码

    【讨论】:

      猜你喜欢
      • 2020-08-17
      • 2022-01-21
      • 2018-05-22
      • 1970-01-01
      • 1970-01-01
      • 2016-05-21
      • 1970-01-01
      • 2019-01-13
      • 2021-08-11
      相关资源
      最近更新 更多