Enforcing Best Practices Incrementally with Betterer in TypeScript
The article discusses the challenge of enforcing best practices in a codebase without having to refactor the entire codebase first. It introduces Betterer, a tool that allows developers to enable rules without fixing all the issues at once. Betterer uses snapshot testing to keep track of known violations as the codebase changes over time. The article provides instructions on how to get started with Betterer and highlights some tests that were useful for the author's team, such as preferring named exports, adopting strict mode in TypeScript, and gradually migrating from JavaScript to TypeScript. Additionally, the article mentions that although Betterer doesn't provide feedback in the IDE, developers can enable ESLint rules as warnings to get instant feedback while writing code. Betterer is a valuable tool for developers who want to enforce best practices incrementally without disrupting the development process.