Skip to content

Linting & Type Checking

Lombok is a Bun workspace monorepo, and every package is held to the same three checks:

  • Prettier — code formatting
  • TypeScript (tsc) — type checking
  • ESLint — linting and import/style rules

These are the same checks CI runs on every pull request, so getting them green locally is the fastest path to a mergeable change.

From the repository root, run all three checks across every package:

Terminal window
./dx check all

This runs Prettier, then TypeScript, then ESLint for each workspace package and prints a summary of any failures at the end. Unlike the individual commands below, check all does not stop at the first failure — it runs every check and reports everything that failed, which is useful before pushing.

Most issues can be fixed automatically:

Terminal window
./dx fix prettier # reformat all packages
./dx fix eslint # apply ESLint autofixes across all packages

After auto-fixing, re-run ./dx check all to confirm everything passes, then commit. Type errors (tsc) are never auto-fixed — those you resolve by hand.

[!NOTE] The current dx implementation supports ./dx fix eslint, even though some older docs and help output emphasize fix prettier more clearly. If this ever changes, treat the dx script itself as the source of truth.

[!NOTE] These checks run on the host and only need dependencies installed, so you do not need the dev container running just to lint or type check.

When you only want one kind of check across all packages:

Terminal window
./dx check prettier # formatting only
./dx check tsc # type checking only
./dx check eslint # linting only

Each of these stops at the first package that fails. For a full pass that surveys every package regardless of failures, prefer ./dx check all.

Each package defines the underlying scripts itself, so you can scope a check to just the package you’re working on using Bun’s --cwd:

Terminal window
bun --cwd packages/ui prettier:check
bun --cwd packages/ui lint:check
bun --cwd packages/ui tsc:check

The standard per-package scripts are:

ScriptWhat it does
prettier:checkVerify formatting
prettier:fixReformat in place
lint:checkRun ESLint
lint:fixRun ESLint with --fix
tsc:checkType check with tsc --noEmit

Substitute any package directory under packages/ such as packages/api, packages/core-worker, or packages/types. This is the most efficient loop while iterating on one package — run only that package’s *:check scripts rather than the whole monorepo.

The dx check and dx fix commands fan out across all workspace packages, including:

  • api
  • ui
  • ui-toolkit
  • types
  • sdk
  • utils
  • auth-utils
  • core-worker
  • worker-utils
  • app-browser-sdk
  • app-worker-sdk

The bundled demo app (packages/demo-apps/simple-demo) is excluded from the workspace but is still linted, formatted, and type checked alongside the others.

You usually do not need to touch these files, but it helps to know where the rules live:

  • Prettier — a single root .prettierrc applies to every package. Ignore patterns live in .prettierignore.
  • ESLint — each package has its own flat-config eslint.config.ts that composes the shared configs in the top-level eslint-config/ directory.
  • TypeScript — a root tsconfig.json plus per-package tsconfig*.json files. tsc:check runs tsc --noEmit; some packages point it at a specific project file.

Because ESLint runs type-aware rules, a package’s TypeScript project has to resolve for linting to succeed.

The repo recommends two VS Code extensions:

  • ESLint — dbaeumer.vscode-eslint
  • Prettier — esbenp.prettier-vscode

Workspace settings enable format-on-save with Prettier and defer to ESLint for linting, so most formatting is handled while you write. Type and ESLint errors still surface inline. Running the commands above before pushing remains the most reliable way to match CI.

CI runs the same per-package prettier:check, lint:check, and tsc:check scripts on every branch except main. If ./dx check all passes locally, the linting workflow should usually pass too.