A Comparison of JavaScript Linting Tools

My understanding is that the criticism of tabs comes down to 1) alignment problems, and 2) editor problems.

Alignment problems because, for example, something like this is common:

(function () {
    // ...
    
    if (cond1
        cond2
        cond3) {
    }
    
    // ...
}());


If you’re going to use tabs to indent and you still want this code to look correctly formatted for everyone else, then you need to take special care to use the right mixture of tabs and spaces.

(function () {
→// ...

→if (cond1
→••••cond2
→••••cond3) {
→}

→// ...
}());

Most people don’t get this mixture right. Even some of the best programmers don’t always get this right. I recall seeing alignment problems in the Linux kernel, for example.

And the other problem is editors, which I’m told sometimes replaces a file’s indentation style to match the editor’s configured style, so code commits end up with a lot of white space diffs.

In a perfect world, tabs would be the way to go. As the argument goes, everyone would get to indent to whatever width they prefer. But, unfortunately, a lot of human error creeps in, and tabs end up doing more harm than good.