如何修复 vscode 中的 eslint 缩进错误?

Xia*_*Lee 5 formatter eslint vue.js visual-studio-code vetur

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

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

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

请告诉我如何修复它,谢谢

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

我的问题片段

问题描述

我的 vscode 设置.json

我的 eslint 规则设置

eve*_*way 1

尝试添加offsetTernaryExpressions到您的 ESLintindent规则配置中。

.eslintrc

rules: {
    'indent': [2, 2, {
        'SwitchCase': 1,
        'offsetTernaryExpressions': true
    }]
}
Run Code Online (Sandbox Code Playgroud)

有关此配置选项的更多信息