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 ?
You can do this by editing your tslint. json file (for TypeScript) or eslint. json file (for JavaScript) and adding / modifying the indent rule, or simply turning the indent validation off.
Using the command ng lint --fix is correct and should fix the indentation.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With