DEV Community

Cover image for Getting Started with eslint-plugin-import-next
Ofri Peretz
Ofri Peretz

Posted on • Edited on

Getting Started with eslint-plugin-import-next

Up to 100x faster than eslint-plugin-import. Flat config native. Bundle optimization included.

πŸ”„ Drop-in replacement β€” 100% compatible with all eslint-plugin-import rules, but faster, LLM-optimized error messages, and fewer false positives/negatives.

Quick Install

npm install --save-dev eslint-plugin-import-next
Enter fullscreen mode Exit fullscreen mode

Flat Config

// eslint.config.js
import importNext from 'eslint-plugin-import-next';

export default [importNext.configs.recommended];
Enter fullscreen mode Exit fullscreen mode

Run ESLint

npx eslint .
Enter fullscreen mode Exit fullscreen mode

Performance

Benchmark Speedup
Core Rules (9 rules) 5.2x faster
Recommended Preset 5.5x faster
no-cycle Rule Only 100x faster πŸ”₯

Tested on 5,000-10,000 files. Full benchmark methodology β†’

πŸ“Š See the full benchmark comparison β†’

Available Presets

// Full compatibility with eslint-plugin-import
importNext.configs.recommended;

// TypeScript-optimized
importNext.configs.typescript;

// Bundle size optimization
importNext.configs.performance;

// Enterprise governance
importNext.configs.enterprise;
Enter fullscreen mode Exit fullscreen mode

Rule Categories

Category Rules Examples
Static Analysis 15 no-unresolved, named, namespace
Module Systems 8 no-commonjs, no-amd, unambiguous
Style Guide 10 order, newline-after-import, first
Bundle Optimization 5 no-barrel-file, prefer-direct-import
Enterprise 3 enforce-team-boundaries, no-legacy-imports

Migration from eslint-plugin-import

# Remove old plugin
npm uninstall eslint-plugin-import eslint-import-resolver-typescript

# Install new plugin
npm install --save-dev eslint-plugin-import-next
Enter fullscreen mode Exit fullscreen mode
// Update config
// Before:
import importPlugin from 'eslint-plugin-import';
export default [importPlugin.configs.recommended];

// After:
import importNext from 'eslint-plugin-import-next';
export default [importNext.configs.recommended];
Enter fullscreen mode Exit fullscreen mode

Quick Reference

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

# Config (eslint.config.js)
import importNext from 'eslint-plugin-import-next';
export default [importNext.configs.recommended];

# Run
npx eslint .
Enter fullscreen mode Exit fullscreen mode

Quick Install

πŸ“¦ npm: eslint-plugin-import-next
πŸ“– Migration Guide
πŸ“– Performance Benchmarks

⭐ Star on GitHub


πŸš€ Tired of slow linting? Share your experience in the comments!

For more updates, follow me on:

GitHub | LinkedIn | Dev.to


Copyright (c) 2025 Ofri Peretz. All rights reserved.

Top comments (0)