{
  "$type": "site.standard.document",
  "description": "## Why not *TypeScript*?\n\nThis is what I initially thought.\n\n- **Higher barrier to entry**.  \n  To a newcomer who might not know what strong typing is, *TypeScript* could feel confusing. As is the added amount of unfamiliar syntax or typing conventions.\n- **Adds a build step**.  \n  Before backend runtimes were able to use type stripping, *TypeScrip\"...",
  "path": "/TypeScript",
  "publishedAt": "2026-05-31T17:54:59.000Z",
  "site": "at://did:plc:rfescy2ghdk6ma2wwwhr3bu2/site.standard.publication/3mktkmfk37k2g",
  "textContent": "## Why not *TypeScript*?\n\nThis is what I initially thought.\n\n- **Higher barrier to entry**.  \n  To a newcomer who might not know what strong typing is, *TypeScript* could feel confusing. As is the added amount of unfamiliar syntax or typing conventions.\n- **Adds a build step**.  \n  Before backend runtimes were able to use type stripping, *TypeScript* was usually executed after a compilation step. Though, for the frontend, a build step is always necessary.\n\nI think convenience is to tell users to just run `npm install`. That’s just one common command when working with the *[[JavaScript]]* ecosystem.\n\n## Why *TypeScript*?\n\n*TypeScript* is pretty necessary for maintenance and reducing guess work.\n\n- Provides documentation.\n- Reliable editor hints.\n- Enforces restraint.\n\nAs *JavaScript* is dynamically typed. Putting some guardrails is only a natural step to better maintenance.\n\n### How I use it\n\nI figured that to get the least number of problems when introducing *TypeScript* to a project, I continued to use *JavaScript* with added *JSDoc* comments. I only use *TypeScript* files for defining complex types. This maintains having no build step.\n\nAn issue with this may be verbosity. Since the *JSDoc* tags are to be in multiple lines, comments can be massive. Solutions to this are in editors:\n\n- [*JSDoc Folder*](https://marketplace.visualstudio.com/items?itemName=aydgn.jsdoc-folder). An extension for *[[Visual Studio Code]]* to automatically collapse documentation comments.\n- [[Explicit folding]].\n\nAn example of a *JavaScript*-only project using *TypeScript* is [*celaria-formats*](https://github.com/BunnyNabbit/celaria-formats).  \n- [`tsconfig.json`](https://github.com/BunnyNabbit/celaria-formats/blob/main/tsconfig.json).\n  - Only checks *JavaScript* if explicitly marked for type checking using `// @ts-check`.\n  - Emits type declarations but is not used for compiling.\n- Documentation generated from *TypeDoc*.\n- [Release workflow](https://github.com/BunnyNabbit/celaria-formats/blob/main/.github/workflows/release.yml) emits type declarations for better support with *TypeScript*-based projects.\n- [Complex types defined in *TypeScript* files](https://github.com/BunnyNabbit/celaria-formats/blob/b1047394281c66c457805afeac5b275a0575f206/types/data.mts#L1). *JavaScript* imports these using the [@import](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import) tag. *TypeScript* is never executed.",
  "title": "TypeScript"
}