{"id":22011,"library":"rollup-plugin-eslint-bundle","title":"rollup-plugin-eslint-bundle","description":"Rollup plugin that runs ESLint validation on the final bundled output rather than individual source files, allowing you to check and auto-fix the generated bundle. Current stable version is 9.0.0, targeting Node >=20, Rollup 4.x, and ESLint >=8.x. The plugin works as a build-time step, useful for enforcing lint rules on the bundle itself (e.g., code style, prohibited patterns). Differentiators: operates on the bundle, not sources; supports ESLint's fix mode; includes both Rollup config and JavaScript API usage. This plugin is actively maintained.","status":"active","version":"9.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/nikolay-borzov/rollup-plugin-eslint-bundle","tags":["javascript","rollup","rollup-plugin","eslint"],"install":[{"cmd":"npm install rollup-plugin-eslint-bundle","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-eslint-bundle","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-eslint-bundle","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: ESLint >=8.x required to perform linting.","package":"eslint","optional":false},{"reason":"Peer dependency: Rollup 4.x required as the plugin host.","package":"rollup","optional":false}],"imports":[{"note":"Package is ESM-only since v9.0.0. Do not use require().","wrong":"const eslintBundle = require('rollup-plugin-eslint-bundle')","symbol":"eslintBundle","correct":"import { eslintBundle } from 'rollup-plugin-eslint-bundle'"},{"note":"This is a named export, not a default export. Default import will fail.","wrong":"import eslintBundle from 'rollup-plugin-eslint-bundle'","symbol":"eslintBundle","correct":"import { eslintBundle } from 'rollup-plugin-eslint-bundle'"},{"note":"Type import: use `import type` to avoid including type at runtime.","wrong":"import { EslintBundleOptions } from 'rollup-plugin-eslint-bundle'","symbol":"EslintBundleOptions","correct":"import type { EslintBundleOptions } from 'rollup-plugin-eslint-bundle'"}],"quickstart":{"code":"import { rollup } from 'rollup';\nimport { eslintBundle } from 'rollup-plugin-eslint-bundle';\n\nconst bundle = await rollup.rollup({\n  input: 'main.js',\n  plugins: [\n    eslintBundle({\n      eslintOptions: {\n        fix: true,\n        overrideConfig: {\n          rules: { 'no-console': 'error' }\n        }\n      },\n      throwOnWarning: true,\n      throwOnError: true,\n      formatter: 'compact'\n    })\n  ]\n});\n\nawait bundle.write({\n  file: 'dist/bundle.js',\n  format: 'esm'\n});\n\nawait bundle.close();","lang":"typescript","description":"Demonstrates basic usage: lint and auto-fix the output bundle with ESLint, throwing on warnings and errors."},"warnings":[{"fix":"Upgrade to Node >=20 and Rollup 4.x.","message":"Version 9.0.0 drops support for Node <20 and requires Rollup 4.x.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"Use import { eslintBundle } from 'rollup-plugin-eslint-bundle'. Remove default import.","message":"Version 9.0.0 switches to named export (eslintBundle). Previously used default export in v8.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"Ensure your project uses ESM (e.g., type: 'module' or .mjs extension).","message":"Version 9.0.0 removes CommonJS support. Plugin is ESM-only.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"Stay on ESLint 8.x until plugin explicitly supports 9.x.","message":"ESLint v8 is the minimum peer dep. ESLint v9 may have breaking changes; check compatibility.","severity":"deprecated","affected_versions":">=9.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Switch to import { eslintBundle } from 'rollup-plugin-eslint-bundle' and ensure your project is ESM.","cause":"Using require() on an ESM-only package.","error":"ERR_REQUIRE_ESM: require() of ES Module /path/to/rollup-plugin-eslint-bundle not supported"},{"fix":"Run npm install rollup-plugin-eslint-bundle and check the import statement.","cause":"Missing dependency or incorrect import path.","error":"Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'rollup-plugin-eslint-bundle'"},{"fix":"Use import { eslintBundle } from 'rollup-plugin-eslint-bundle'.","cause":"Using default import instead of named import.","error":"TypeError: eslintBundle is not a function"},{"fix":"Provide an ESLint config file (e.g., .eslintrc) or set overrideConfig in eslintOptions.","cause":"Missing ESLint config file or overrideConfig in eslintOptions.","error":"Error: ESLint configuration error: No configuration found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}