Javascript
-
Bulk suppressions, native in eslint
∞At Pallet I found these to be an essential part of allowing our eslint rules to change. Essentially bulk suppressions allow you to keep a file tracking everywhere the code violates existing lint rules because the code predates the new lint rules. This is cleaner than using
// eslint-diableeverywhere and prevent normalizing disabling lint rules all the time, since all the disables are separate.Yes, ideally, when you introduce a new rule (like
no-floating-promises, a literal savior of sanity in the cruel world of JavaScript race conditions), it would be way better to go and fix all the instances. But that can change behaviors you don’t always expect. Or, more plainly, it’s just a lot of work to be able to take advantage of a new rule. So rather than try to go strive for perfection in your code base you can make things better, right now, and eventually get everything into compliance (if ever).This capability has existed for a long time in the patch package
eslint-bulk, but seeing it native in eslint means it’ll be less finicky to work with (the package above takes a bit of finesse to work correctly since it overrides eslint’s suppression system). -
Remeda
∞If you’re greenfielding a JavaScript application, I can’t recommend enough starting with Remeda. The main reason here is that unlike lodash, Remeda is composable and functional, but unlike something like Ramda, you aren’t forced to use data last all the time. In the same breath:
const items = [1, 2, 3]; const doubled = R.map(items, (x) => x * 2); const doubleSquared = R.pipe( R.map((x) => x * 2), R.map((x) => x ** 2), );It makes functional programming practical in the semi-functional style that works really well in modern TypeScript.