ESLint plugin (v1.0.1, 2025) enforcing explicit .js extensions in local imports, aiding migration from CommonJS to ESM. Supports ESLint v9 with flat config and leverages existing import resolvers (node, webpack, typescript) to handle alias-based imports. Configurable ignored extensions and index file patterns, with --fix auto-correction. A more powerful alternative to eslint-plugin-require-extensions, supporting resolver aliases (e.g., webpack resolve.alias, tsconfig paths).
npm install eslint-plugin-esm-importNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup for v1.x with ESLint v9 flat config, import, and auto-fix.
Upgrade ESLint to v9 and migrate to flat config (eslint.config.js). See eslint-plugin-esm-import README for migration.
Update to v1.0.1 with ESLint v9 config.
Ensure your project uses import/export syntax. The plugin will not modify require() calls.
Verify that your ESLint config includes a resolver (e.g., import/resolver: { node: {}, typescript: {} }).Run: npm install --save-dev eslint-plugin-esm-import
Use default import: import esmImport from 'eslint-plugin-esm-import'; then reference esmImport.configs.recommended.
Use import syntax: import esmImport from 'eslint-plugin-esm-import' in a .mjs or package.json type: module file.