eslint-plugin-import-lite
raw JSON → 0.6.0 verified Sat Apr 25 auth: no javascript
A lightweight ESLint plugin for import/export linting that ports useful rules from eslint-plugin-import-x without requiring a resolver or heavy dependencies. Current stable version 0.6.0 supports ESLint 9 and 10, requires Node >=18.18, and ships zero runtime dependencies. Key differentiators: no binary resolver, no Babel/Flow support, purely ESLint flat config, TypeScript types included. Released under MIT, with monthly updates since initial release in 2025. Ideal for users of @antfu/eslint-config who want import rules without resolver overhead.
Common errors
error Error [ERR_REQUIRE_ESM]: require() of ES Module ... ↓
cause Package is ESM-only; CommonJS require() fails.
fix
Use import syntax, ensure parent package is ESM, or use dynamic import().
error Failed to load plugin 'import-lite': Cannot find module 'eslint-plugin-import-lite' ↓
cause Plugin not installed or not in node_modules.
fix
Run: npm install eslint-plugin-import-lite --save-dev
error Invalid config: "import-lite/first" has been removed. ↓
cause Trying to use a rule that was not ported or removed in later version.
fix
Check src/rules directory for available rules; only 9 rules are implemented.
Warnings
breaking v0.3.0 renames options for 'consistent-type-specifier-style' ↓
fix Update rule options to match new naming: preferAutomatic -> preferPreferAutomatic (check docs).
gotcha Plugin is ESM-only; requires Node >=18.18 and ESLint flat config (no .eslintrc). ↓
fix Use import syntax and flat config. Switch to module type or use .mjs extension.
gotcha No resolver support – rules that need module resolution (e.g., 'no-unresolved') are not included. ↓
fix Use eslint-plugin-import-x or configure a resolver separately if needed.
deprecated Dropped Babel and Flow support since v0.1.0 ↓
fix Migrate TypeScript/JavaScript code away from Babel/Flow-specific syntax.
Install
npm install eslint-plugin-import-lite yarn add eslint-plugin-import-lite pnpm add eslint-plugin-import-lite Imports
- plugin wrong
const plugin = require('eslint-plugin-import-lite')correctimport plugin from 'eslint-plugin-import-lite' - rules wrong
const { rules } = require('eslint-plugin-import-lite')correctimport { rules } from 'eslint-plugin-import-lite' - configs
import { configs } from 'eslint-plugin-import-lite'
Quickstart
// eslint.config.js
import plugin from 'eslint-plugin-import-lite';
export default [
...plugin.configs.recommended,
// Override rules if needed
{
rules: {
'import-lite/first': 'error',
'import-lite/no-default-export': 'warn',
},
},
];