Registry / testing / eslint-flat-config-utils

eslint-flat-config-utils

JSON →
library3.1.0jsnpmunverified

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.

npm install eslint-flat-config-utils
INSTALL
IMPORT
SIG · ESLINT-FLAT-CONFIG
E
eslint-flat-config-utils
testingjavascriptv3.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

concat
import { concat } from 'eslint-flat-config-utils'
const { concat } = require('eslint-flat-config-utils')
ESM-only since v2.0.0; require() will fail.
composer
import { composer } from 'eslint-flat-config-utils'
import composer from 'eslint-flat-config-utils'
Default import is not available; composer is a named export.
ConfigNames
import { ConfigNames } from 'eslint-flat-config-utils'
import { ConfigName } from 'eslint-flat-config-utils'
Type export for config names used in composer.override, etc. Plurals only.
resolveExtends
import { resolveExtends } from 'eslint-flat-config-utils'
Introduced in v3.0.0 to handle extends resolution via @eslint/config-helpers.

Chain composer to merge, rename and remove rules in ESLint flat config.

import { composer } from 'eslint-flat-config-utils' const config = await composer( { name: 'base', plugins: { 'my-plugin': { rules: { 'my-rule': 'error' } } }, rules: { 'my-plugin/my-rule': 'error' } }, { name: 'typescript', files: ['*.ts'], rules: { 'no-console': 'warn' } } ) .override('typescript', { rules: { 'no-console': 'off' } }) .renamePlugins({ 'my-plugin': 'renamed' }) .removeRules('no-console') export default config
Debug
Known issues
breakingv2.0.0 dropped CommonJS support; now ESM-only.
fix
Convert require() to import statements and ensure package.json has 'type': 'module'.
affects: >=2.0.0
deprecatedv2.x resolveExtends behavior changed in v3.0.0 to require @eslint/config-helpers.
fix
Update code to use new resolveExtends signature or update imports if previously using older version.
affects: >=3.0.0
gotchacomposer.renamePlugins only applies to plugins and rules present in the config array; does not mutate original objects.
fix
Always await/reassign the composer result to get the renamed config.
affects: >=1.0.0
gotchadisableRulesFix hijacks plugin's meta.fixable property; may not work with all plugins (e.g., those that cache fixable status).
fix
Test with targeted plugins; consider alternative like overriding rule options with meta.fixable: null if supported.
affects: >=1.1.0
breakingv3.0.0 changed config resolution for extends; previous behavior (string extends) now handled by @eslint/config-helpers.
fix
Ensure @eslint/config-helpers is installed if using extends in config files.
affects: >=3.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/eslint-flat-config-utils/index.mjs not supported.
Package is ESM-only since v2.0.0; require() fails in CommonJS context.
fix
Use dynamic import() or switch to ESM: add 'type': 'module' to package.json and replace require() with import.
TypeError: composer(...).append is not a function
composer call not awaited or not properly chained after async operations.
fix
Ensure the composer chain is properly written: await composer(...).append(...); or use the fluent API synchronously.
Cannot find module 'eslint-flat-config-utils' or its corresponding type declarations.
Missing installation or TypeScript cannot resolve the package types.
fix
Install the package: npm install eslint-flat-config-utils. For TypeScript, ensure tsconfig.json includes 'moduleResolution': 'node' or 'bundler'.
TypeError: Cannot destructure property 'concat' of '...' as it is undefined.
Attempted to require() named export in CJS after v2.0.0, but package no longer exports CJS.
fix
Use import { concat } from 'eslint-flat-config-utils' or call dynamic import().
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
eslint-flat-config-utils — npm install eslint-flat-config-utils · libregistry