Skip to content

Configuration

Create lombok.config.ts in your project root (or run lombok-ts init).

ts
import { defineConfig } from 'lombok-typescript';

export default defineConfig({
  backend: 'legacy',
  codegen: {
    outputDir: '.lombok',
    include: ['src/**/*.ts'],
    exclude: ['**/*.test.ts', '**/*.spec.ts'],
    tsConfigPath: 'tsconfig.json',
  },
});

defineConfig is a typed identity helper — use it for autocomplete in your editor.

Top-level fields

FieldTypeDefaultDescription
backend'legacy' | 'stage3' | 'auto''auto'Which decorator standard to assume
logPartial<LogConfig>Future @Log settings (Phase 2+)
builderPartial<BuilderConfig>Builder naming (prefix, buildMethodName, builderMethodName)
formatToStringPartial<ToStringConfig>@ToString format (pretty, json, compact)
validatePartial<ValidateConfig>Future @Validate settings (Phase 5+)
codegenPartial<CodegenConfig>Code generation options

codegen fields

FieldDefaultDescription
outputDir'.lombok'Directory for .lombok.ts and .lombok.d.ts files
include['src/**/*.ts']Globs of source files to scan
excludetests, dist, .lombokGlobs to skip
tsConfigPath'tsconfig.json'Project tsconfig used by the analyzer
watchfalseNot implemented — Phase 2

CLI overrides

bash
lombok-ts generate --output-dir custom-out --ts-config tsconfig.build.json

CLI flags override values from the config file for that run.

Backend selection

Set backend: 'legacy' or 'stage3' explicitly in library-heavy monorepos. 'auto' reads compiler options from tsConfigPath when present.

Released under the MIT License.