{"id":19796,"library":"eslint-plugin-importer","title":"eslint-plugin-importer","description":"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.","status":"active","version":"0.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/sxzz/eslint-plugin-importer","tags":["javascript","eslint","plugin","import","typescript"],"install":[{"cmd":"npm install eslint-plugin-importer","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-importer","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-importer","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, required to load the plugin","package":"eslint","optional":false}],"imports":[{"note":"ESM-only since v0.1.0; plugin object exposes rules mapping.","wrong":"const importer = require('eslint-plugin-importer')","symbol":"default","correct":"import importer from 'eslint-plugin-importer'"},{"note":"Named export for rule definitions; TypeScript types available.","wrong":"","symbol":"rules","correct":"import { rules } from 'eslint-plugin-importer'"},{"note":"Config presets exported as named object; no separate configs module.","wrong":"import configs from 'eslint-plugin-importer/configs'","symbol":"configs","correct":"import { configs } from 'eslint-plugin-importer'"}],"quickstart":{"code":"// eslint.config.js\nexport default [\n  {\n    plugins: {\n      importer: (await import('eslint-plugin-importer')).default,\n    },\n    rules: {\n      'importer/no-default-export': 'error',\n      'importer/no-duplicates': 'warn',\n    },\n  },\n];","lang":"typescript","description":"Configures ESLint flat config with eslint-plugin-importer using dynamic import (ESM) and enables two example rules."},"warnings":[{"fix":"Rename rule to `no-duplicates-specifier`.","message":"Rule `import-dedupe` was renamed to `no-duplicates-specifier` in v0.2.0. Using old rule name will throw an error.","severity":"breaking","affected_versions":"<0.2.0"},{"fix":"Use `preferInline` instead.","message":"Rule `prefer-inline` was renamed to `preferInline` in v0.1.1. Using the old name will silently fail or cause undefined rule.","severity":"breaking","affected_versions":"<0.1.1"},{"fix":"Migrate to non-Flow rules or use eslint-plugin-import-x for Flow support.","message":"Flow support was removed in v0.2.1. Rules that depended on Flow parsing may be disabled or removed.","severity":"breaking","affected_versions":">=0.2.1"},{"fix":"For resolution, use `eslint-plugin-import-x`. This plugin is strictly syntax-only.","message":"The plugin does not perform module resolution; `import/no-unresolved` is not implemented. Use eslint-plugin-import-x for resolution features.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use dynamic `import()` in flat config or convert project to ESM.","message":"CommonJS `require()` does not work; plugin is ESM-only. Attempting `require('eslint-plugin-importer')` throws MODULE_NOT_FOUND or ERR_REQUIRE_ESM.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use `import()` or set `type: \"module\"` in package.json and use ESM imports.","cause":"Package is ESM-only and cannot be required() in CommonJS context.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/eslint-plugin-importer/dist/index.mjs not supported."},{"fix":"// eslint.config.js\nimport importer from 'eslint-plugin-importer'\nexport default [\n  {\n    plugins: { importer },\n    rules: { 'importer/no-default-export': 'error' },\n  },\n];","cause":"Plugin not registered in `plugins` object when using flat config.","error":"ESLint configuration error: Config (flat) 'importer' is not a valid plugin name (missing 'plugins' entry?)"},{"fix":"Prefix rule with 'importer/', e.g., 'importer/no-duplicates'.","cause":"Rule name mismatch: package uses `importer/no-duplicates` not `import/no-duplicates`.","error":"Rule 'import/no-duplicates' is not defined in eslint-plugin-importer"},{"fix":"Use import { configs } from 'eslint-plugin-importer'.","cause":"Package does not export `configs` as separate module path; only named export.","error":"Cannot find module 'eslint-plugin-importer/configs'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}