Kora/developer documentation/Tooling

Tooling

Lint, typecheck and the code style Kora modules follow.

Checks

From the Kora folder:

npm run typecheck
npm run typecheck:modules
npm run lint

npm run typecheck verifies the core framework against tsconfig.backend.json. npm run typecheck:modules verifies all modules in modules/ against tsconfig.module.json. npm run lint:fix fixes what it can. For dashboard views, also run this in src/dashboard:

bun x tsc --noEmit

Type Declarations

Type declarations live in src/types/:

  • src/types/kora/: Core framework declarations and third-party package augmentations (index.d.ts, packages.d.ts).
  • src/types/modules/: Module base classes and handler interfaces (index.d.ts, types.d.ts).

package.json maps subpath imports with explicit types targets:

package.json
{
  "imports": {
    "#kora": {
      "types": "./src/types/kora/index.d.ts",
      "default": "./src/kora/index.js"
    },
    "#kora/modules": {
      "types": "./src/types/modules/index.d.ts",
      "default": "./src/modules/index.js"
    }
  }
}

This configuration gives editor autocomplete and type safety without co-located .d.ts files or compilation steps.

Lint Rules

The lint fails on:

  • Comments that explain code.
  • Optional chaining (?.) and nullish coalescing (??).
  • else if. Use early returns, a lookup table or switch.
  • var, == and unused variables.

Style

Official modules also follow these:

  • 4 spaces, ESM, one class per file.
  • No constants or variables that are only used once. Inline them.
  • No helper that only renames another call.
  • No || fallbacks for values. Check explicitly.
  • Plain method names such as get, load, start and handle.
  • Code in src/, config and setup in resources/.
  • No em or en dashes, in code or text.