删除终端中显示 Ember Handlebars Indentation Error

Remove showing Ember Handlebars Indentation Error in terminal

<h2> Login Here </h2>
<form {{action="authenticate" on = "submit"}}>
    {{input type = "text" value=username placeholder="username"}}
    {{input type = "password" value=password placeholder="password"}}
    <button type = "submit"> Login </button>
</form>

即使这个简单的 Ember 程序显示缩进错误,这对 运行 代码没有任何问题,但仍然令人恼火。请找到解决方案以消除显示缩进错误

Ember 模板 lint 默认使用 2 个空格进行缩进。您似乎使用了 4 个空格或制表符。

这应该会消除您的 linting 错误:

<h2> Login Here </h2>
<form {{action="authenticate" on = "submit"}}>
  {{input type = "text" value=username placeholder="username"}}
  {{input type = "password" value=password placeholder="password"}}
  <button type = "submit"> Login </button>
</form>

此外,我不知道您对 linting 有多熟悉,但不需要修复程序才能正确。它的唯一目的是帮助代码风格,以便在具有多个团队成员的大型项目中保持一致。

取决于您安装的 linter,(也许是这个:https://github.com/ember-template-lint/ember-template-lint), you can change the rules to fit your code style: https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rules.md