canirequire › Dual (CommonJS + ESM) › eslint-plugin-unused-imports
Is eslint-plugin-unused-imports ESM-only? Can you require() it?
Report and remove unused es6 modules
Last verified Sep 9, 2026 against eslint-plugin-unused-imports@4.4.1. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
eslint-plugin-unused-imports publishes both a CommonJS entry and a native ESM entry (ESM added in 4.1.0). require("eslint-plugin-unused-imports") and import "eslint-plugin-unused-imports" both work on every supported Node.js version and in Bun.
Does eslint-plugin-unused-imports@4.4.1 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("eslint-plugin-unused-imports") from a CommonJS file and import "eslint-plugin-unused-imports" from an ES module.
| Runtime | require("eslint-plugin-unused-imports") | import "eslint-plugin-unused-imports" |
|---|---|---|
| Node.js 18 | ✓ works | ✓ works |
| Node.js 20 | ✓ works | ✓ works |
| Node.js 22 | ✓ works | ✓ works |
| Node.js 24 | ✓ works | ✓ works |
| Node.js 26 | ✓ works | ✓ works |
| Bun 1.4 | ✓ works | ✓ works |
How to import eslint-plugin-unused-imports
ES modules (import)
import eslintPluginUnusedImports from "eslint-plugin-unused-imports";CommonJS (require)
const eslintPluginUnusedImports = require("eslint-plugin-unused-imports");Module format by version
Derived from the type, main and exports fields of every stable release on npm (30 versions; the newest 30 shown).
| Versions | Format | First published |
|---|---|---|
| 4.1.0 – 4.4.1 | Dual (CommonJS + ESM) | Aug 8, 2024 |
| 0.0.2 – 4.0.1 | CommonJS | Sep 18, 2019 |
Frequently asked
Is eslint-plugin-unused-imports ESM-only?
eslint-plugin-unused-imports@4.4.1 ships CommonJS and ESM builds. eslint-plugin-unused-imports publishes both a CommonJS entry and a native ESM entry (ESM added in 4.1.0). require("eslint-plugin-unused-imports") and import "eslint-plugin-unused-imports" both work on every supported Node.js version and in Bun.
Can I require eslint-plugin-unused-imports?
Yes. eslint-plugin-unused-imports ships a CommonJS entry, so require("eslint-plugin-unused-imports") works on every Node.js version, alongside the native ESM entry for import.
Does eslint-plugin-unused-imports work in Bun?
Yes. import "eslint-plugin-unused-imports" loaded successfully in Bun 1.4 on Sep 9, 2026.
Does eslint-plugin-unused-imports ship TypeScript types?
Yes. eslint-plugin-unused-imports bundles its own type declarations; no @types package is needed.
Links
Other dual (commonjs + esm) packages
- minimatch 10.2.6Dual
- brace-expansion 5.0.9Dual
- lru-cache 11.5.2Dual
- glob 13.0.6Dual
- eslint-visitor-keys 5.0.1Dual
- yallist 5.0.0Dual
- balanced-match 4.0.4Dual
- js-yaml 5.4.1Dual
Similar popularity
- update-notifier 7.3.1ESM-only
- webpack-bundle-analyzer 5.3.2CommonJS
- @svgr/webpack 8.1.0CommonJS
- jest-junit 17.0.0CommonJS
- copy-webpack-plugin 14.0.0CommonJS
- case-sensitive-paths-webpack-plugin 2.4.0CommonJS
- aws-sdk 2.1693.0CommonJS
- resolve-url-loader 5.0.0CommonJS