Registry / testing / eslint-plugin-importer

eslint-plugin-importer

JSON →
library0.3.0jsnpmunverified

An ESLint plugin that provides a subset of import/export rules from eslint-plugin-import and eslint-plugin-antfu. Current stable version is v0.3.0 (supports ESLint v9 and v10). Zero dependencies, no module resolution — only focuses on import/export syntax. Active development with frequent breaking changes in minor versions due to rule renames and removals. Compared to eslint-plugin-import, it is leaner but may not support all scenarios (e.g., no Flow support since v0.2.1). Ships TypeScript types.

npm install eslint-plugin-importer
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-IMPO
E
eslint-plugin-importer
testingjavascriptv0.3.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import importer from 'eslint-plugin-importer'
const importer = require('eslint-plugin-importer')
ESM-only since v0.1.0; plugin object exposes rules mapping.
rules
import { rules } from 'eslint-plugin-importer'
Named export for rule definitions; TypeScript types available.
configs
import { configs } from 'eslint-plugin-importer'
import configs from 'eslint-plugin-importer/configs'
Config presets exported as named object; no separate configs module.

Configures ESLint flat config with eslint-plugin-importer using dynamic import (ESM) and enables two example rules.

// eslint.config.js export default [ { plugins: { importer: (await import('eslint-plugin-importer')).default, }, rules: { 'importer/no-default-export': 'error', 'importer/no-duplicates': 'warn', }, }, ];
Debug
Known issues
breakingRule `import-dedupe` was renamed to `no-duplicates-specifier` in v0.2.0. Using old rule name will throw an error.
fix
Rename rule to `no-duplicates-specifier`.
affects: <0.2.0
breakingRule `prefer-inline` was renamed to `preferInline` in v0.1.1. Using the old name will silently fail or cause undefined rule.
fix
Use `preferInline` instead.
affects: <0.1.1
breakingFlow support was removed in v0.2.1. Rules that depended on Flow parsing may be disabled or removed.
fix
Migrate to non-Flow rules or use eslint-plugin-import-x for Flow support.
affects: >=0.2.1
gotchaThe plugin does not perform module resolution; `import/no-unresolved` is not implemented. Use eslint-plugin-import-x for resolution features.
fix
For resolution, use `eslint-plugin-import-x`. This plugin is strictly syntax-only.
affects: >=0.0.1
gotchaCommonJS `require()` does not work; plugin is ESM-only. Attempting `require('eslint-plugin-importer')` throws MODULE_NOT_FOUND or ERR_REQUIRE_ESM.
fix
Use dynamic `import()` in flat config or convert project to ESM.
affects: >=0.1.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/eslint-plugin-importer/dist/index.mjs not supported.
Package is ESM-only and cannot be required() in CommonJS context.
fix
Use `import()` or set `type: "module"` in package.json and use ESM imports.
ESLint configuration error: Config (flat) 'importer' is not a valid plugin name (missing 'plugins' entry?)
Plugin not registered in `plugins` object when using flat config.
fix
// eslint.config.js
import importer from 'eslint-plugin-importer'
export default [
  {
    plugins: { importer },
    rules: { 'importer/no-default-export': 'error' },
  },
];
Rule 'import/no-duplicates' is not defined in eslint-plugin-importer
Rule name mismatch: package uses `importer/no-duplicates` not `import/no-duplicates`.
fix
Prefix rule with 'importer/', e.g., 'importer/no-duplicates'.
Cannot find module 'eslint-plugin-importer/configs'
Package does not export `configs` as separate module path; only named export.
fix
Use import { configs } from 'eslint-plugin-importer'.
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency, required to load the plugin
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-importer — npm install eslint-plugin-importer · libregistry