About Indentation #14835
Replies: 1 comment 1 reply
-
You would need to create a custom rule for that. You can start by copying the existing indent rule and modify it to do what you want.
no-tabs checks for tab characters anywhere in the file, not just indents. It also has an option to not check indents. no-tabs was added for JSCS compatibility. Most of them time you just want to use indent. |
Beta Was this translation helpful? Give feedback.
-
Hello,
Politely, I regard forcing a developer to use either spaces or tabs as something dumb. That is the developer's choice to make.
Though the important consideration is consistency within files written by said developer.
So, how can I add a rule to allow both tabs and spaces but validate consistency within a file?
For example, either 4 spaces or 1 tab consistently in a file.
Also, why is there a
"no-tab"
rule apart from the"indent"
rule? what happens if I chose"indent": ["error", "tab"]
together with"no-tab": "error"
? Is this contradiction by design?I hope I can get I kind response. I couldn't find anything out there, including stackoverflow.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions