Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is a nit pick, but isn't his "Ambiguous curly braces" example actually breaking due to automatic semicolon insertion?

return {{a: 4}}

Isn't valid anyways. ESLint easily flags it as an error.



Exactly: Linting rules requiring semicolons should be considered a best practice.

But I think TypeScript should also be considered a best practice, and between the two that would solve pretty much all of his complaints.

Well, that and using "==" to compare to null, vs. "===" to compare to everything else. But the linters all can make that distinction as well.

But he explicitly hates on linters in the article as well. And dismisses TypeScript and Flow ... because his coworkers aren't being forced to use it? THAT is the real problem, I think...


For anyone else reading this in the future, I should mention that the ESLint 'no-unreachable' rule will catch this even if you don't require semicolons.


Good point!

Didn't say this explicitly, but TypeScript will, by default, prohibit unreachable code as well. [1]

[1] "allowUnreachableCode" defaults to false: https://www.typescriptlang.org/docs/handbook/compiler-option...




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: