by NateEag · 3y ago · 0 comments
I'd recommend a different strategy, personally:
Write a POC linter that demonstrates the features you think ESLint is missing, with no regard for interface consistency or backwards compatibility.
Once that's done, integrate it in a few real-world projects that currently use ESLint. See what the devs scream about, as well as what they like about it.
With all that data in hand, now you come up with a plan for making the desired changes to existing ESLint, being willing to consider the option of "nuke everything in the new branch".
You'd keep continuity of history for any files that aren't completely deleted, and you might find that you don't need to gut things as thoroughly as you expect.
However… when code is the problem, rewrites make a lot of sense. Eslint is a very well understood program, there’s absolute clarity about what it does and what it should do across contributors, and they’re constantly battling bad code. A rewrite, in this situation, where other problems have been ruled out, is probably a good option.
> I don't believe continually to make incremental changes will get us to where ESLint needs to go if it wants to be around in another ten years.
The scale of years for rewrite and migration seems right.
Rewriting from scratch may make plenty of sense. A completely new architecture should not be held back by any remnants of the old implementation. The old test suite is indispensable though, and the old sets of rules are an important source to consult (even if not to directly incorporate).
One thing that stands out is that they haven’t grown twice the manpower with institutional knowledge overnight. You have to put a lot of effort into your rewrite, and you have to fix bugs in the existing thing.
I do see your point, though.
- If you've worked with the library (as a maintainer/developer, not as a user) for a long time you know where the fundamental pain points are and, after a while, the desire to get rid of those pain points can become overwhelming.
- Languages evolve; what might have seemed like a good architectural decision 3 or 4 years ago may well have turned out to be a quagmire of confusion now, which new features in the language (JS examples: promises; fetch; various Array functions) can help simplify.
- Rewriting from scratch can also encourage a better, more maintainable approach to code documentation (and generating online documentation from it).
- Being able to dump outdated/questionable tests in favour of modern testing best practice is always welcome.
- A rewrite from scratch can offer a chance to reconsider the developer experience for people who consume the library in their projects/products - though there's a danger that moving too far away from existing practices can damage trust in the library.
... Of course, rewriting from scratch is always a lot easier if your library is (relatively) obscure. I imagine the ESLint rewrite is going to be performed in the full glare of the spotlight - see already the lively conversations around the decision to not rewrite in TypeScript!
[1] - Speaking from the experience of rewriting my (very obscure) JS canvas library from scratch 3 times over the past 10 years