Disable "space indentation expected" errors

时间:2018-03-25 19:51:18

标签: angular-cli

Running ng lint gives me a lot of "space indentation expected" errors, reason being me using tabs instead of spaces. I'd be ok using 4 spaces instead of the tabs, but I can't work with 2-space-indentations.

I understand that the angular cli team currently doesn't have any plans to change the 2 space indentations, but is there any way of configuring the linter that it doesn't raise warnings about it?

Excluding all .ts files from linting is not a feasable option for me, putting "tslint:disable-next-line:indent" in all of the files like suggested here is also quite annoying.

1 个答案:

答案 0 :(得分:3)

"indent": [
  true,
  "tabs",
  4
],
tslint.json中的

做了伎俩。请参阅文档中的this参考。