import type { Preset } from '.'; interface CustomPresetOptions { source?: string; export?: string; require?: string; dev?: boolean; } /** * Define your own codegen function, which will receive all options specified. * * Import the `Preset` type from this library to define a strongly-typed preset function: * * @example * export const jsonPrinter: import('eslint-plugin-codegen').Preset<{myCustomProp: string}> = ({meta, options}) => { * const components = meta.glob('**\/*.tsx') // uses 'globSync' from glob package * const json = JSON.stringify({filename: meta.filename, customProp: options.myCustomProp, components}, null, 2) * return `export default ${json}` * } * * // codegen:start {export: jsonPrinter} * * @description * This can be used in other files by specifying the `source` option like: * * * `