Factory & Presets
The main entrypoint @eienjs/eslint-config exports the eienjs factory function, preset constants, helper functions, and TypeScript definitions.
eienjs(options)
Creates a composable ESLint Flat Config pipeline using FlatConfigComposer.
import type { ConfigNames, OptionsConfig, TypedFlatConfigItem } from '@eienjs/eslint-config';
import type { FlatConfigComposer } from 'eslint-flat-config-utils';
declare function eienjs(
options?: OptionsConfig & Omit<TypedFlatConfigItem, 'files' | 'ignores'>,
): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
Example
import { eienjs } from '@eienjs/eslint-config';
export default eienjs({
adonisjs: true,
formatters: true,
typescript: {
erasableSyntaxOnly: true,
tsconfigPath: 'tsconfig.json',
},
});
Config Presets
@eienjs/eslint-config exports two preset constants useful for testing, inspection, or building custom baselines.
CONFIG_PRESET_FULL_ON
Enables every available integration and option (adonisjs, astro, formatters, gitignore, imports, jsdoc, jsonc, markdown, node, nuxt, perfectionist, pnpm, regexp, stylistic with experimental: true, test, toml, typescript with tsconfigPath: 'tsconfig.json' and erasableSyntaxOnly: true, unicorn, vue, and yaml).
import { CONFIG_PRESET_FULL_ON, eienjs } from '@eienjs/eslint-config';
export default eienjs({
...CONFIG_PRESET_FULL_ON,
astro: false,
});
CONFIG_PRESET_FULL_OFF
Disables all optional integrations so you can opt into only the specific features you want:
import { CONFIG_PRESET_FULL_OFF, eienjs } from '@eienjs/eslint-config';
export default eienjs({
...CONFIG_PRESET_FULL_OFF,
stylistic: true,
typescript: true,
});
Factory Helpers
defaultPluginRenaming
The default plugin rename mapping applied when autoRenamePlugins: true:
const defaultPluginRenaming = {
'import-lite': 'import',
'vitest': 'test',
'yml': 'yaml',
};
resolveSubOptions(options, key)
Extracts the sub-options object for a given key in OptionsConfig (returning {} if the value is a boolean or undefined).
getOverrides(options, key)
Extracts the overrides rules record for a given key in OptionsConfig.
Exported Types
All configuration interfaces and rule types are exported from @eienjs/eslint-config:
OptionsConfig: Main options interface foreienjs().TypedFlatConfigItem: Flat config item with typedrules(Rules) andplugins.ConfigNames: Union type of all named config blocks (e.g.'eienjs/typescript/rules','eienjs/adonisjs/rules').RuleOptions&Rules: Autocompleted rule definitions generated byeslint-typegen.OptionsAdonisJS,OptionsNuxt,OptionsVue,OptionsTypescript,OptionsErasableSyntaxOnly,OptionsFormatters,OptionsUnicorn,OptionsMarkdown,OptionsPnpm,OptionsRegExp,StylisticConfig.
