JSDoc banners
ttsc is the standalone TypeScript-Go compiler β see Setup if you havenβt installed it yet.
@ttsc/banner adds a fixed @packageDocumentation JSDoc banner to the top of every emitted file. Common case: a license / copyright line at the top of your published package.
Install
npm install -D @ttsc/bannerConfigure (file form β recommended)
Create banner.config.ts next to tsconfig.json:
import type { TtscBannerConfig } from "@ttsc/banner";
export default {
text: "License MIT (c) 2026 Acme",
} satisfies TtscBannerConfig;Register the plugin in tsconfig.json:
{
"compilerOptions": {
"plugins": [{ "transform": "@ttsc/banner" }]
}
}Run ttsc. Every emitted .js and .d.ts gets:
/**
* License MIT (c) 2026 Acme
*
* @packageDocumentation
*/Configure (inline form)
If you donβt want a separate config file:
{
"compilerOptions": {
"plugins": [
{
"transform": "@ttsc/banner",
"text": "License MIT (c) 2026 Acme"
}
]
}
}Required configuration
If @ttsc/banner is installed but neither banner.config.ts nor an inline text can be found, the compile fails. This is deliberate β banners are not silently skipped.
Common use cases
- License headers at the top of every file in a published library.
- Generated-file warnings β
"β οΈ Generated by codegen β do not edit by hand." - Build provenance β
"Built from commit @{COMMIT_SHA}"(interpolation is up to your build script; the banner plugin itself takes a fixed string).
See also
- Plugins β the plugin index.
- @ttsc/paths β another emit-time plugin.
- Plugin Development β write your own.
Last updated on