{"id":19677,"library":"eslint-merge-processors","title":"ESLint Merge Processors","description":"A utility to combine multiple ESLint processors into a single processor, enabling parallel linting of different file types within one ESLint configuration. Current stable version is 2.0.0, which is ESM-only and requires ESLint flat config. Maintained by Anthony Fu, it differentiates from manual chaining by providing a clean merge function and a pass-through processor for original files. It is commonly used with eslint-plugin-markdown to lint both the markdown file and its embedded code snippets.","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/antfu/eslint-merge-processors","tags":["javascript","eslint","eslint-processor","typescript"],"install":[{"cmd":"npm install eslint-merge-processors","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-merge-processors","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-merge-processors","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is ESM-only since v2.0.0; require() will fail with Node.js ESM or bundler. Use dynamic import() in CJS environments.","wrong":"const { mergeProcessors } = require('eslint-merge-processors')","symbol":"mergeProcessors","correct":"import { mergeProcessors } from 'eslint-merge-processors'"},{"note":"The correct named export is processorPassThrough, not passThrough. It is a separate export from mergeProcessors.","wrong":"import { passThrough } from 'eslint-merge-processors'","symbol":"processorPassThrough","correct":"import { processorPassThrough } from 'eslint-merge-processors'"},{"note":"The package does not have a default export. Only named exports (mergeProcessors, processorPassThrough) are available.","wrong":"import mergeProcessors from 'eslint-merge-processors'","symbol":"default import","correct":"import eslintMergeProcessors from 'eslint-merge-processors'"}],"quickstart":{"code":"import { mergeProcessors, processorPassThrough } from 'eslint-merge-processors';\nimport markdown from 'eslint-plugin-markdown';\n\nexport default [\n  {\n    files: ['**/*.md'],\n    plugins: {\n      markdown\n    },\n    processor: mergeProcessors([\n      processorPassThrough,\n      markdown.processors.markdown\n    ])\n  }\n];","lang":"typescript","description":"Shows how to combine a pass-through processor with eslint-plugin-markdown's processor to lint both the .md file and its code snippets."},"warnings":[{"fix":"Switch to import syntax or use dynamic import() in CommonJS. Update your ESLint config to use flat config (ESLint >=9).","message":"v2.0.0 drops CommonJS (CJS) support; the package is now ESM-only. Attempting to require() will throw a ModuleError.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Ensure processorPassThrough is first if you want to lint the original file alongside other processors.","message":"The order of processors in the array matters. Processors are applied in sequence; later processors will see the already-modified file from earlier processors.","severity":"gotcha","affected_versions":"*"},{"fix":"Test the combination thoroughly; consider filing issues upstream for incompatible processors.","message":"Not all ESLint processors are compatible with merging. Some processors may assume they have exclusive control over the file and may conflict.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install eslint-merge-processors' in your project root.","cause":"Package not installed or version mismatch in older npm/yarn.","error":"Cannot find module 'eslint-merge-processors'"},{"fix":"Use dynamic import: const { mergeProcessors } = await import('eslint-merge-processors'); or convert your project to ESM.","cause":"Using require() to import an ESM-only package in CommonJS.","error":"require() of ES Module not supported"},{"fix":"Ensure you are using named imports: import { mergeProcessors } from 'eslint-merge-processors'. Check tsconfig.json for 'moduleResolution' set to 'node' or 'node16'.","cause":"TypeScript not recognizing the export due to wrong import syntax or missing type declarations.","error":"Property 'mergeProcessors' does not exist on type 'typeof import(\"eslint-merge-processors\")'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}