Comment

Comment by CGamesPlay

This is pretty compelling. Why isn't it in the "recommended" preset of lints?

In general, I find it frustrating that the eslint recommended presets don't document why they are recommended. I disable several of the rules in all my projects because they seem to be arbitrary stylistic choices (e.g. [0], [1], [2]).

[0] https://typescript-eslint.io/rules/no-empty-function/

[1] https://github.com/jsx-eslint/eslint-plugin-react/blob/maste...

[2] Specifically checkLoops of https://eslint.org/docs/latest/rules/no-constant-condition

[edit] In looking up no-empty-function, I saw a stack overflow post that provides a compelling alternative of using `() => undefined` instead of `() => {}`, which suppresses the error. That should be shown as an example on the eslint page!

parent CGamesPlay 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton