{"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,"search_vec":"'2.0.0':30 'anthoni':43 'chain':49 'clean':53 'code':83 'combin':7 'common':67 'config':40 'configur':25 'current':26 'differ':19 'differenti':46 'embed':82 'enabl':15 'eslint':1,9,24,38,71,86,88 'eslint-plugin-markdown':70 'eslint-processor':87 'esm':34 'esm-on':33 'file':20,64,79 'flat':39 'fu':44 'function':55 'javascript':85 'lint':17,75 'maintain':41 'manual':48 'markdown':73,78 'merg':2,54 'multipl':8 'one':23 'origin':63 'parallel':16 'pass':59 'pass-through':58 'plugin':72 'processor':3,10,14,61,89 'provid':51 'requir':37 'singl':13 'snippet':84 'stabl':27 'type':21 'typescript':90 'use':68 'util':5 'version':28 'within':22","created_at":"2026-04-25T11:19:03.947426+00:00","updated_at":"2026-04-25T11:19:03.947426+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/antfu/eslint-merge-processors","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-merge-processors","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}