Space Indentation Expected in ng lint

喜你入骨 提交于 2019-12-10 02:33:29

问题


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 ?


回答1:


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

If you want to use 4 spaces:

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

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

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

See this section of the docs for reference.




回答2:


If anyone came here because they're seeing this in vscode despite having a perfectly good tab at the start of the line do this: Hit F1, type 'tabs' and select 'Convert indentation to tabs' and that should resolve it.



来源:https://stackoverflow.com/questions/46605561/space-indentation-expected-in-ng-lint

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!