Skip to main content
interlace
Plugin: import-next

Overview

Drop-in replacement for eslint-plugin-import with 8x faster cycle detection

Live from GitHub

This content is fetched directly from README.md on GitHub and cached for 1 hour.

3.1x Faster End-to-End, 8x in Rule Time

Measured on a 5,736-file / 455K-LoC React codebase: full lint 51.7s → 16.7s, no-cycle rule time 39.2s → 4.9s, with 100% detection parity. See benchmarks.


Live README from GitHubfrom eslint-plugin-import-next/README.md, cached for 1 hour.Edit on GitHub
Interlace

  

oxlint

  

ESLint

Next-generation import sorting, validation, and architectural boundaries.

NPM VersionNPM DownloadsPackage LicenseCodecovSince Dec 2025

⭐ If this plugin caught a real bug for you, star the repo — it's the signal that keeps these rules maintained.

Description

This plugin provides Next-generation import sorting, validation, and architectural boundaries.

Philosophy

Interlace fosters strength through integration. Instead of stacking isolated rules, we interlace security directly into your workflow to create a resilient fabric of code. We believe tools should guide rather than gatekeep, providing educational feedback that strengthens the developer with every interaction.

Getting Started

npm install eslint-plugin-import-next --save-dev

⚙️ Configuration Presets

PresetDescription
recommendedWarns on import order issues
strictAll rules set to error for production-ready code
typescriptOptimized for TypeScript projects
module-resolutionFocus on import resolution
import-styleFocus on import formatting
esmEnforce ES Modules only
architectureClean architecture boundaries
performanceBundle optimization (barrel detection)
enterpriseTeam boundaries & legacy import tracking
errorsMatches eslint-plugin-import errors preset
warningsMatches eslint-plugin-import warnings preset

🔄 Parity with eslint-plugin-import

RuleOriginal PluginStatusNotes
All Ruleseslint-plugin-import npm✅ SupportedFull drop-in replacement

🧬 Deep dependency graphs

import/no-cycle crashes on deep import chains. import-next/no-cycle does not.

Cycle detection is a strongly-connected-components pass over your module graph. Done recursively — one JavaScript stack frame per module — a chain deeper than the engine's call stack throws RangeError: Maximum call stack size exceeded. ESLint then exits 2 with no results at all: not a slow lint, no lint. Both rules default to unlimited traversal depth, so nothing caps the descent.

import-next runs the same traversal on an explicit stack, so its ceiling is heap rather than stack.

See it yourself

npm i -D eslint eslint-plugin-import eslint-plugin-import-next
curl -O https://raw.githubusercontent.com/ofri-peretz/eslint/main/benchmarks/scripts/repro-deep-chain.mjs
node repro-deep-chain.mjs 6000
chain depth: 6000 modules

eslint-plugin-import         FAILED after 93.6s — RangeError: Error while loading rule 'import/no-cycle': Maximum call stack size exceeded
eslint-plugin-import-next    completed in 18.2s

Measured on Node 24 / darwin-arm64 with ESLint 10.7. The exact depth at which the recursive implementation dies varies with Node version and platform stack size — around 5,000 modules here.

Chains get deep by accident

Hand-written 5,000-module chains are rare. These are not:

  • generated clients and schema bindings, where each type re-exports the next
  • barrel files (index.ts) re-exporting barrels, several layers down
  • long export … from ladders in a monorepo's shared packages

Depth accumulates through re-export edges, which is exactly what the rule follows.

Speed, for completeness

Across graph shapes at 5,000 files each, import-next is ~1.1× faster on dense cyclic graphs and on cold single-file runs, and ties on graphs with no cycles to find. The wide/shallow shape is unresolved — two runs disagree (0.8× sequential, 1.01× interleaved) and the machine has not been quiet enough to settle it, so no claim is made there. On a real 455K-line React codebase it is 8× faster in rule time and 3.1× end-to-end at 100% detection parity.

Speed is the smaller story. The deep-chain result above is a difference in kind, not degree.

Detection parity is checked per shape before any timing is trusted, and every number comes from a committed result file:

📦 Compatibility

PackageVersion
ESLint^8.40.0 || ^9.0.0 || ^10.0.0
Node.js>=18.0.0

See the ESLint Version Support Policy for the full matrix.

Rules

Legend

IconDescription
💼Recommended: Included in the recommended preset.
⚠️Warns: Set to warn in recommended preset.
🔧Auto-fixable: Automatically fixable by the --fix CLI option.
💡Suggestions: Providing code suggestions in IDE.
🚫Deprecated: This rule is deprecated.
🟢Type-unaware: AST-only, runs in oxlint JS-plugin tier.
🟡Type-aware (refining): pure-AST primary path; types refine precision.
🟠Type-aware (graceful): requires TS program; silent without it.

Part of the Interlace ESLint Ecosystem — AI-native security plugins with LLM-optimized error messages:

PluginDownloadsDescription
eslint-plugin-secure-codingdownloadsGeneral security rules & OWASP guidelines.
eslint-plugin-pgdownloadsPostgreSQL security & best practices.
eslint-plugin-node-securitydownloadsNode.js core-module security (fs, child_process, vm, crypto, Buffer).
eslint-plugin-jwtdownloadsJWT security & best practices.
eslint-plugin-browser-securitydownloadsBrowser-specific security & XSS prevention.
eslint-plugin-express-securitydownloadsExpress.js security hardening rules.
eslint-plugin-lambda-securitydownloadsAWS Lambda security best practices.
eslint-plugin-nestjs-securitydownloadsNestJS security rules & patterns.
eslint-plugin-mongodb-securitydownloadsMongoDB security best practices.
eslint-plugin-vercel-ai-securitydownloadsVercel AI SDK security hardening.
eslint-plugin-import-nextdownloadsNext-gen import sorting & architecture.

⭐ Support & follow

If this plugin caught a real bug for you, star the repo — stars are the signal that keeps the Interlace ESLint ecosystem maintained — and follow the writeups on Dev.to for the benchmarks and security research behind these rules.

GitHub stars

📄 License

MIT © Ofri Peretz

ESLint Interlace Plugin

Interlace

View README.md on GitHub →

Building secure JavaScript with Interlace? Star the repo to get new rules and CWE coverage as we ship them — or follow the AI-code-security benchmarks behind them.

On this page

No Headings