import type { OptionsConfig, OptionsTypescript, TypedFlatConfigItem } from '@antfu/eslint-config'; import antfu from '@antfu/eslint-config'; /** Maninak-specific options layered on top of antfu's. All optional. */ export interface ManinakExtraOptions { /** * When true, require a JSDoc block on `export`ed functions, classes, and methods in folders * that conventionally hold reusable utilities e.g. `utils/`, `lib/`, etc. * `@param` and `@returns` tags stay optional; a free-text description alone is enough * of a contract. * * Test files e.g. `*.test.*`, `*.spec.*`, are always exempt even when their path matches one * of the utility globs. * * Default: `false`. Off by default to keep the preset lower friction. */ requireJsdocInUtils?: boolean; } /** * Maninak's public options type. Extends antfu's `OptionsConfig` with `ManinakExtraOptions` * and widens `typescript.tsconfigPath` to accept a string array. antfu only accepts a single * string (it feeds it into `projectService.defaultProject`), but the maninak factory detects * an array and switches the resulting parser blocks to legacy `parserOptions.project` mode, * which natively accepts multiple paths. */ export type ManinakOptions = Omit & ManinakExtraOptions & { typescript?: boolean | (Omit & { tsconfigPath?: string | string[]; }); }; /** * Build the final ESLint flat config array using the maninak preset. * * Wraps antfu's factory with the maninak ruleset and, when the consumer has Nuxt * installed, the official Nuxt flat config. Type-aware rules activate automatically * when a `tsconfig.json` exists at cwd, or when an explicit `typescript.tsconfigPath` * is provided. `tsconfigPath` accepts a string or a string array (useful when some * tsconfigs use non-standard names that TypeScript's project service won't discover). * * @param options Same shape as antfu's options, extended with maninak-specific knobs (see * {@link ManinakExtraOptions}). Common antfu keys: `typescript`, `vue`, `react`, `svelte`, * `stylistic`, `ignores`. Maninak's defaults (e.g. `stylistic: false`, rule overrides) * deep-merge with what you pass; your values win on conflict. * @param userConfigs Additional flat-config items appended after maninak's * blocks, so they override everything that came before. * * @example Minimal usage in `eslint.config.mjs` * ```ts * import maninak from '@maninak/eslint-config' * * export default maninak() * ``` * * @example Multiple tsconfigs when non-standard names rule out auto-discovery * ```ts * export default maninak({ * typescript: { * tsconfigPath: ['./tsconfig.json', './test/tsconfig.wdio.json'], * }, * }) * ``` * * @example Append a project-specific block that overrides a rule * ```ts * export default maninak( * {}, * { * files: ['src/legacy/**'], * rules: { 'ts/no-explicit-any': 'off' }, * }, * ) * ``` * * @example Opt in to JSDoc requirements for utility code * ```ts * export default maninak({ * requireJsdocInUtils: true, * }) * ``` */ export declare function maninak(options?: ManinakOptions, ...userConfigs: Parameters['1'][]): Promise;