I laugh when I see those 50-page English-language documents describing how some institution wants code to be formatted. Ain't nobody got time for that.
What situations have you found where automated formatting doesn’t suffice or has these limits?
Some tools order/deduplicate imports. Prettier does not. [1]
And no tool that I've seen orders fields/constructor/method, etc.
But in any cases, all formatters allow you to selectively disable it for certain liners.
It would be, but as you can see in the linked issue, it was closed for being a non-goal. So, it's not likely to change.
(Prettier generally keeps the AST identical; i.e. whitespace and parentheses changes only.)
That said, I haven't seriously tried programming using variable width fonts; maybe it's a well-kept secret to digesting code. Or maybe it's like Hemp Milk, there's a reason it hasn't caught on.
PS: The idea is not mine but I can't remember where I read the instructions about this editor setup, so Google is your friend.
https://gist.githubusercontent.com/diegoperini/853d54c8873e7...
* to be fair, I’d have trouble with a bad proportional font like Times New Roman, but I’m sure many would have trouble with Courier New on the other side, the specific font matters.
And you can still manually format code, serif or monospace.
Proportional or monospace font choice is orthogonal to formatting.
(Edited to be more specific)
Mono space allows you to do manual alignment, eg if you want ascii art in your code or non standard formatting. Doing this with a proportional font means other people can’t read your code without using the same font.
EDIT: looks like the tool support is so bad, Horstmann himself pretty much gave up: http://horstmann.com/unblog/2010-06-28/braces.html
At the end of the day, it is important that the code looks like it was written by one consistent person and not 20 random different people.
I really don't like the mandatory use of eslint (used as style enforcement), prettier, etc. When used as a bat to hit developers over the head, all this tells me is that the organization has too many anti-social developers that can't check their ego at the door.
Often someone will recommend a tool or technology in place of simple social common sense. If a developer can't follow the existing code style, they should be shunned. It's their problem. It's not a problem to solve with a fancy tool. You solve this particular problem by telling that person that they are an asshole. Using technology to solve social problems just exacerbates the problem.
All of that leads to a situation where we can't have nice things. You go into a codebase and see hundreds of exceptions to turn off eslint or whatever. Instead of just working around one-off style exceptions with common sense (who really gives a damn if a line needs broken/indented a certain way for a specific function) you have to plead with the style cops to let you off each and every time.
Developers really hate each other. Small organizations or teams tend to be a bit better in my experience. There is more camaraderie. But I often feel like I'm in a group of mercenaries, each ready to stab you in the back.
I certainly could go through and make sure all the spacing is exactly right, the functions/properties are in the right place, and rest of the rules of the styleguide are followed. But it's much easier to do when you get a warning, squiggly, or can use an autoformatter to match the rules.
I would never intentionally violate a rule, but I might forget a rule or miss a violation. With linters this is not an issue, the machine will let you know.
Everyone can focus on the correctness and quality of code and let the machine worry about making sure everything is formatted correctly.
Clearly the project you describe, where linting is disabled every other line is bad. But I wouldn't blame the linter for that. I don't know what can be done if a team has such a commitment to their own style that they put in the extra work to disable the linter.
A linter is not a tool for punishing people who violate a style guide, it's an assistant for people who are trying to follow a style guide.
My experience is: each time a team started doing this, all coding-style related discussions vanished, and it became a non-issue. It turns out it's a lot easier to accept a coding style you're not the one doing the actual formatting (this is why, BTW, I think stylechecking hooks alone are a bad idea).