Stop relying on deprecated tooling. Learn how to migrate your TypeScript project from TSLint to ESLint using the modern Flat Configuration (eslint.config.mjs) for better performance, stricter type safety, and a superior developer experience.

Introduction

TSLint has been deprecated for years, but many legacy projects (and their forks) still rely on it. In this post, I’ll show you how we migrated our repository to ESLint using the modern Flat Configuration, improving both performance and developer experience.

Why Migrate?

  • Deprecated Stack: TSLint no longer receives updates.
  • Improved Performance: ESLint (especially with Flat Config) is significantly faster.
  • Modern Ecosystem: Better compatibility with modern tooling (Prettier, Jest, VS Code).
  • Stricter Type Safety: Catch common bugs like floating promises and unsafe type assignments.

The Migration Journey

Step 1: Out with the Old

I started by clearing out the legacy TSLint packages and the tslint.json file.

pnpm remove tslint tslint-config-prettier
rm tslint.json

Step 2: In with the New

I installed the core ESLint dependencies and the new typescript-eslint toolkit.

pnpm add -D eslint typescript-eslint globals

Step 3: Configuring for the Future

The new eslint.config.mjs setup is much cleaner and more modular. Here’s a snippet of our final configuration: Link

Step 4: Fixing the Fun Stuff

The migration revealed several hidden issues in our codebase:

  • Floating Promises: Discovered several unawaited calls that could cause race conditions.
  • Type Safety: Tightened up areas where any was being used loosely.

Results

  • [*] Faster linting: Noticeably faster.
  • [*] Better DX: Integrated seamlessly with our IDEs.
  • [*] Cleaner Code: Caught several bugs that TSLint missed.

Conclusion

Don’t wait! Migrating to ESLint is an investment in your project’s long-term health. The Flat Config system makes the setup more intuitive than ever.

Follow my journey at Fastify API with TypeScript