【问题标题】:how to fix the eslint indent error in vscode?如何修复 vscode 中的 eslint 缩进错误?
【发布时间】:2021-08-11 20:35:13
【问题描述】:

对不起,我的英语不好,但我需要知道如何解决它。

我尝试使用每个缩进规则,它不起作用......

希望我使用 Vetur 格式化程序时一切顺利。

请告诉我如何解决它,谢谢

https://eslint.org/docs/rules/no-mixed-spaces-and-tabs#disallow-mixed-spaces-and-tabs-for-indentation-no-mixed-spaces-and-tabs

my question snippets

question description

my vscode setting.json

my eslint rules setting

【问题讨论】:

    标签: vue.js visual-studio-code eslint formatter vetur


    【解决方案1】:

    尝试将 offsetTernaryExpressions 添加到您的 ESLint indent 规则配置中。

    .eslintrc

    rules: {
        'indent': [2, 2, {
            'SwitchCase': 1,
            'offsetTernaryExpressions': true
        }]
    }
    

    More information on this configuration option

    【讨论】:

      猜你喜欢
      • 2018-08-19
      • 2019-01-13
      • 2016-07-28
      • 2019-01-16
      • 2020-09-28
      • 2022-11-21
      • 2018-05-03
      • 1970-01-01
      • 2018-07-18
      相关资源
      最近更新 更多