Why eslint-plugin-import Takes 45 Seconds (And How We Fixed It)

Published: (December 31, 2025 at 12:34 AM EST)
2 min read
Source: Dev.to

Source: Dev.to

Your CI is slow. Your pre‑commit hooks timeout. Developers disable linting to ship faster.
The culprit? eslint-plugin-import.

Problem

┌─────────────────────────────────────────────────────┐
│ Linting 10,000 files                                │
├─────────────────────────────────────────────────────┤
│ eslint-plugin-import:      45.0s  ███████████████████│
│ eslint-plugin-import-next:  0.4s  ▏                  │
└─────────────────────────────────────────────────────┘

That’s a 100× speed‑up.

// eslint-plugin-import resolves EVERY import from scratch
import { Button } from '@company/ui'; // Resolves entire package
// On every lint run. Every file. Every import.

import/no-cycle performance killer

The import/no-cycle rule builds a complete dependency graph.

  • For N files with M imports each:
    • Time complexity: O(N × M²)
    • Memory: entire graph in RAM

Result: out‑of‑memory errors on large monorepos.

Real GitHub issues

  • “import/no-cycle takes 70 % of lint time” ( #2182 )
  • “OOM checking circular dependencies”
  • “Minutes to lint a monorepo”

Every lint run repeats the same work—no incremental analysis.

Solution

We rebuilt module resolution with a new plugin that adds caching and memoization.

Feature comparison

Featureeslint-plugin-importeslint-plugin-import-next
Caching❌ None✅ Cross‑file shared cache
Cycle detectionO(N × M²)O(N) with memoization
TypeScript resolver🐌 Slow⚡ Native TS support
Flat Config support⚠️ Partial✅ Native

Migration steps

npm uninstall eslint-plugin-import
npm install --save-dev eslint-plugin-import-next
// eslint.config.js
import importNext from 'eslint-plugin-import-next';

export default [importNext.configs.recommended];

That’s it—same rules, ~100× faster.

Benchmark

# With eslint-plugin-import
time npx eslint --no-cache .
# With eslint-plugin-import-next
time npx eslint --no-cache .

Get started

  • 📦 npm: eslint-plugin-import-next
  • ⭐ Star the project on GitHub and run the benchmark yourself.
  • 🚀 If your CI is slow, drop a comment with your lint times!

Follow for more performance deep‑dives: GitHub | LinkedIn

Back to Blog

Related posts

Read more »

Getting Started with eslint-plugin-pg

Quick Install bash npm install --save-dev eslint-plugin-pg Flat Config js // eslint.config.js import pg from 'eslint-plugin-pg'; export default pg.configs.reco...