Lint
IFC TypeScript's lint plugin in the ESLint plugin format (commons lint 0001-lint FR-001), named ifc, which bun lint loads from this file as it is (TypeScript, no build): bun lint --plugin=<path to lint/plugin.ts> --rule '{"ifc/no-vendor-api": ["error", {...}]}' for one run, or in bunfig.toml:
[lint]
plugins = ["./lint/plugin.ts"] # relative to bunfig.toml
[lint.rules]
"ifc/no-vendor-api" = ["error", { allow = [{ files = "src/host/**", reason = "the one module that wraps the vendor's API" }] }]
"ifc/terminal-writers" = ["error", { allow = [{ files = "src/console.ts", reason = "the renderer, the one writer for a person" }] }]The rules every harness wants, each taking its lists from its options so that a harness keeps its own lists and adds its own rules (as its own plugin, with defineRule of ./rule.ts):
no-vendor-api: no member of a vendor's global (Bun.*and the like) outside the files listed with their reasons;no-registry-import: nonpm:,jsr:or URL specifier;import-boundary: a relative import that leaves its package (the optionroots) is refused;module-doc: every file begins with a JSDoc block that says@module;switch-absurd: aswitchon a union'skindends indefaultcallingabsurd;terminal-writers: no write to the terminal outside the files listed with their reasons.