ng lint 中的空格缩进 [英] Space Indentation Expected in ng lint

查看:20
本文介绍了ng lint 中的空格缩进的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行 ng lint 时不断收到错误需要空格缩进".在我的应用程序中有相当多的行存在相同的问题.我该如何解决这个警告?有没有人遇到过类似的问题?

I keep getting error "space indentation expected" while running ng lint. It is a quite amount of lines that having the same issue in my application. How can I solve this warning? Is anyone having face the similar issue ?

推荐答案

默认情况下 ng lint 要求缩进为 2 个空格.您可以在 tslint.json 中更改这些设置.

By default ng lint expects indentation to be 2 spaces. You can change these settings in your tslint.json.

如果要使用 4 个空格:

If you want to use 4 spaces:

"indent": [
    true,
    "spaces",
    4
]

如果您想使用制表符(4 个空格宽):

If you want to use tabs (4 spaces wide):

"indent": [
    true,
    "tabs",
    4
]

请参阅文档的部分以供参考.

See this section of the docs for reference.

这篇关于ng lint 中的空格缩进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆