Sign in
Log inSign up

Is developing ESLint rules worth it?

Matija Marohnić's photo
Matija Marohnić
·Jan 7, 2018

Just a while ago I was in love with ESLint. I like how it underlines mistakes as you type, rather than you having to discover them later on. I feel that my code is cleaner and I can detect possible bugs sooner.

However, as soon as I started developing ESLint rules, things changed for me, I realized how dirty and complicated this logic can be, e.g. the indent rule contains over a thousand lines.

Currently I'm updating react/jsx-key to not warn if .map() is being called inside React.Children.toArray(), and I have to say that it's not so simple because there are so many different ways a developer can write code, they can reassign variables under different names, use arrow functions or regular functions etc., so I have to account for as many of these as I can, because ESLint does static analysis, it doesn't actually run the code.

Are the benefits of ESLint worth all that trouble? I know I should make that decision for myself, I just wanted to hear your opinions.