Tooling
Lint, typecheck and the code style Prism modules follow.
Checks
From the Prism folder:
npm run typecheck
npm run typecheck:modules
npm run lintnpm 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 web views and anything in src/web, also run this in src/web:
bun x tsc --noEmitDo not build the web app yourself. Prism builds it on start whenever the source changes, and module views are compiled when they load.
Type Declarations
Type declarations live in src/types/:
src/types/prism/: 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:
{
"imports": {
"#prism": {
"types": "./src/types/prism/index.d.ts",
"default": "./src/prism/index.js"
},
"#prism/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 orswitch.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,startandhandle. - Code in
src/, config and setup inresources/. Nolibfolders. - No module-specific code in Prism itself or in
src/web. Everything a module shows comes from its own pages, config and lang. - Every string translated into all 16 languages.
- No em or en dashes, in code or text.
Git
Each official module lives in its own git worktree on an orphan module/<name> branch, checked out into modules/<name>.