{"id":19469,"library":"esbuild-plugin-eslint","title":"esbuild-plugin-eslint","description":"Integrates ESLint linting into esbuild bundles as a plugin. Current stable version is 0.3.12, requires Node >=18, esbuild >=0.20, and ESLint ^8 || ^9. Provides configurable options like filter, throwOnError, throwOnWarning, and fix. Ships TypeScript types and is actively maintained. Differentiators: lightweight, supports modern ESLint flat config, and works seamlessly with esbuild's onLoad hooks.","status":"active","version":"0.3.12","language":"javascript","source_language":"en","source_url":"https://github.com/robinloeffel/esbuild-plugin-eslint","tags":["javascript","esbuild","plugin","esbuild-plugin","eslint","lint","typescript"],"install":[{"cmd":"npm install esbuild-plugin-eslint","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-eslint","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-eslint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for plugin to function.","package":"esbuild","optional":false},{"reason":"Peer dependency required for linting.","package":"eslint","optional":false}],"imports":[{"note":"Default ESM export only; CJS require not supported in v0.3+.","wrong":"const eslint = require('esbuild-plugin-eslint')","symbol":"eslint","correct":"import eslint from 'esbuild-plugin-eslint'"},{"note":"Type import for configuration options.","wrong":"","symbol":"type EsbuildPluginEslintOptions","correct":"import type { EsbuildPluginEslintOptions } from 'esbuild-plugin-eslint'"},{"note":"esbuild is a peer dependency; must be imported separately.","wrong":"","symbol":"build (esbuild)","correct":"import { build } from 'esbuild'"}],"quickstart":{"code":"import { build } from 'esbuild';\nimport eslint from 'esbuild-plugin-eslint';\n\nawait build({\n  entryPoints: ['src/index.js'],\n  outfile: 'dist/bundle.js',\n  bundle: true,\n  plugins: [\n    eslint({\n      filter: /\\.(?:jsx?|tsx?|mjs|cjs)$/,\n      throwOnError: true,\n      fix: true\n    })\n  ]\n});\nconsole.log('Build complete');","lang":"typescript","description":"Shows minimal setup using esbuild with the eslint plugin, filtering JS/TS files and throwing on errors."},"warnings":[{"fix":"Upgrade Node to >=18, esbuild to >=0.20, and eslint to ^8 || ^9.","message":"Dropped support for Node <18, esbuild <0.20, and eslint <8 in v0.3.0","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Use import eslint from 'esbuild-plugin-eslint' instead of require().","message":"Default export changed from CommonJS to ESM in v0.3.0 – require() no longer works","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Rename include to filter; note that filter accepts a RegExp, not a string.","message":"Option 'include' deprecated in favor of 'filter' in v0.2.0","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Explicitly set filter to /.*/ to lint all files, or adjust regex to cover desired extensions.","message":"Plugin only runs on files matching the filter regex; files outside filter (e.g., .css) are not linted","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Remove formats option; configure output format via ESLint's --format or formatter options.","message":"Option 'formats' was removed; use eslint's built-in configuration for format in v0.3.0","severity":"deprecated","affected_versions":">=0.3.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install esbuild-plugin-eslint eslint --save-dev","cause":"Package not installed or symlink issue","error":"Cannot find module 'esbuild-plugin-eslint'"},{"fix":"Use import eslint from 'esbuild-plugin-eslint'","cause":"Using require() in ESM context","error":"The plugin 'eslint' must be a function"},{"fix":"Ensure you are using import eslint from 'esbuild-plugin-eslint' in an ESM project","cause":"Incorrect import (e.g., default import syntax used with CJS module)","error":"TypeError: eslint is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}