{"id":19634,"library":"eslint-flat-config-utils","title":"eslint-flat-config-utils","description":"Utils for managing and manipulating ESLint flat config arrays. Current stable version is 3.1.0, released actively by antfu. Provides helpers like concat (flatten and merge configs/promises), composer (chainable API for appending, prepending, inserting, renaming plugins, overriding rules, removing rules, and disabling rule fixes), and resolveExtends for extending configs. Differentiators: chainable composer extends Promise for direct use in eslint.config.mjs; renamePlugins, removeRules, disableRulesFix are unique helpers not found in standard ESLint utilities. ESM-only since v2.0.0, TypeScript-ready with shipped types, and supports @eslint/config-helpers for extends resolution since v3.0.0.","status":"active","version":"3.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/antfu/eslint-flat-config-utils","tags":["javascript","eslint","eslint-flat-config","typescript"],"install":[{"cmd":"npm install eslint-flat-config-utils","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-flat-config-utils","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-flat-config-utils","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only since v2.0.0; require() will fail.","wrong":"const { concat } = require('eslint-flat-config-utils')","symbol":"concat","correct":"import { concat } from 'eslint-flat-config-utils'"},{"note":"Default import is not available; composer is a named export.","wrong":"import composer from 'eslint-flat-config-utils'","symbol":"composer","correct":"import { composer } from 'eslint-flat-config-utils'"},{"note":"Type export for config names used in composer.override, etc. Plurals only.","wrong":"import { ConfigName } from 'eslint-flat-config-utils'","symbol":"ConfigNames","correct":"import { ConfigNames } from 'eslint-flat-config-utils'"},{"note":"Introduced in v3.0.0 to handle extends resolution via @eslint/config-helpers.","wrong":"","symbol":"resolveExtends","correct":"import { resolveExtends } from 'eslint-flat-config-utils'"}],"quickstart":{"code":"import { composer } from 'eslint-flat-config-utils'\n\nconst config = await composer(\n  {\n    name: 'base',\n    plugins: {\n      'my-plugin': { rules: { 'my-rule': 'error' } }\n    },\n    rules: {\n      'my-plugin/my-rule': 'error'\n    }\n  },\n  {\n    name: 'typescript',\n    files: ['*.ts'],\n    rules: {\n      'no-console': 'warn'\n    }\n  }\n)\n  .override('typescript', { rules: { 'no-console': 'off' } })\n  .renamePlugins({ 'my-plugin': 'renamed' })\n  .removeRules('no-console')\n\nexport default config","lang":"typescript","description":"Chain composer to merge, rename and remove rules in ESLint flat config."},"warnings":[{"fix":"Convert require() to import statements and ensure package.json has 'type': 'module'.","message":"v2.0.0 dropped CommonJS support; now ESM-only.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Update code to use new resolveExtends signature or update imports if previously using older version.","message":"v2.x resolveExtends behavior changed in v3.0.0 to require @eslint/config-helpers.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Always await/reassign the composer result to get the renamed config.","message":"composer.renamePlugins only applies to plugins and rules present in the config array; does not mutate original objects.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Test with targeted plugins; consider alternative like overriding rule options with meta.fixable: null if supported.","message":"disableRulesFix hijacks plugin's meta.fixable property; may not work with all plugins (e.g., those that cache fixable status).","severity":"gotcha","affected_versions":">=1.1.0"},{"fix":"Ensure @eslint/config-helpers is installed if using extends in config files.","message":"v3.0.0 changed config resolution for extends; previous behavior (string extends) now handled by @eslint/config-helpers.","severity":"breaking","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use dynamic import() or switch to ESM: add 'type': 'module' to package.json and replace require() with import.","cause":"Package is ESM-only since v2.0.0; require() fails in CommonJS context.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/eslint-flat-config-utils/index.mjs not supported."},{"fix":"Ensure the composer chain is properly written: await composer(...).append(...); or use the fluent API synchronously.","cause":"composer call not awaited or not properly chained after async operations.","error":"TypeError: composer(...).append is not a function"},{"fix":"Install the package: npm install eslint-flat-config-utils. For TypeScript, ensure tsconfig.json includes 'moduleResolution': 'node' or 'bundler'.","cause":"Missing installation or TypeScript cannot resolve the package types.","error":"Cannot find module 'eslint-flat-config-utils' or its corresponding type declarations."},{"fix":"Use import { concat } from 'eslint-flat-config-utils' or call dynamic import().","cause":"Attempted to require() named export in CJS after v2.0.0, but package no longer exports CJS.","error":"TypeError: Cannot destructure property 'concat' of '...' as it is undefined."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}