Customization
Composer & Overrides
Override rules per preset or compose custom flat config items using FlatConfigComposer.
eienjs() returns an instance of FlatConfigComposer from eslint-flat-config-utils, giving you full type-safe control to append, prepend, replace, or override any named config item.
Rule Overrides per Integration
Almost every integration option in eienjs() accepts an overrides object to customize rules specifically for that domain:
eslint.config.js
import { eienjs } from '@eienjs/eslint-config';
export default eienjs({
javascript: {
overrides: {
'no-console': 'off',
},
},
perfectionist: {
overrides: {
'perfectionist/sort-objects': 'error',
},
},
test: {
overrides: {
'test/prefer-lowercase-title': 'off',
},
},
typescript: {
overrides: {
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
},
},
});
Chaining with FlatConfigComposer
Because eienjs() returns a FlatConfigComposer, you can chain methods like .append(), .prepend(), .override(), .overrideRules(), and .remove() directly on the result:
eslint.config.js
import { eienjs } from '@eienjs/eslint-config';
export default eienjs({
typescript: {
tsconfigPath: 'tsconfig.json',
},
})
.append({
files: ['src/**/*.ts'],
name: 'my-project/src-rules',
rules: {
'perfectionist/sort-objects': 'error',
},
})
.override('eienjs/typescript/rules', {
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
},
});
Useful Composer Methods
| Method | Description |
|---|---|
.append(...configs) | Appends one or more flat config items or promises to the end of the config array. |
.prepend(...configs) | Prepends one or more flat config items to the beginning of the config array. |
.override(name, config) | Merges additional configuration into a named config block (autocomplete supported via ConfigNames). |
.overrideRules(rules) | Overrides severity or options for rules that are already enabled in any config block. |
.remove(name) | Removes a specific named config block (e.g. 'eienjs/jsdoc/rules'). |
.renamePlugins(map) | Renames plugin prefixes across all configs and rules. |
Plugin Prefix Renaming
By default (autoRenamePlugins: true), @eienjs/eslint-config normalizes several plugin prefixes to keep rule names concise and consistent:
| Original Plugin Prefix | Renamed Prefix | Example Rule |
|---|---|---|
import-lite | import | import/first |
vitest | test | test/consistent-test-it |
yml | yaml | yaml/sort-keys |
If you prefer to keep the original upstream plugin prefixes, set autoRenamePlugins: false:
eslint.config.js
import { eienjs } from '@eienjs/eslint-config';
export default eienjs({
autoRenamePlugins: false,
});
