build-free-types

Configure JSDoc and erasable TypeScript for type checking without a build step.

4.4k|1.3k|Updated Jan 23, 2012
One-click install
npx skills add https://github.com/paulirish/dotfiles --skill build-free-types
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-free-types
Source: https://github.com/paulirish/dotfiles/tree/main/agents/paulirish-skills/skills/build-free-types
Command: npx skills add https://github.com/paulirish/dotfiles --skill build-free-types

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables type safety without a build step by using JSDoc in browser code and erasable syntax TypeScript for Node.js execution.

Core Features & Use Cases

  • Browser-based type safety: annotate plain .js files with JSDoc to get IDE support and runtime compatibility without transpiling.
  • Node.js execution with erasable syntax: write .ts files that run directly on Node.js (v24.11.0+) without a build step, provided you avoid non-erasable features.
  • Configuration guidance: apply strict type-checking and module settings via package.json and tsconfig.json to enforce an end-to-end type-safe workflow.

Quick Start

Use the build-free-types skill to enable type checking without a build step by applying JSDoc in .js files and erasable syntax TypeScript in .ts files, then run npm run typecheck.

Frequently Asked Questions about build-free-types

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get type checking in JavaScript without a build step?

Type checking without a build step is achievable by annotating plain .js files with JSDoc for browser code and using erasable syntax TypeScript for Node.js execution.

Can I run TypeScript files directly in Node.js without transpiling?

Yes, you can run .ts files directly in Node.js (v24.11.0+) without a build step by using only erasable syntax features, avoiding non-erasable TypeScript constructs that require transpilation.

What is erasable syntax TypeScript and how does it enable build-free type safety?

Erasable syntax TypeScript refers to type annotations that can be safely stripped at runtime without transpilation. It enables build-free type safety by allowing direct Node.js execution while retaining strict type checking.

How do I configure package.json and tsconfig.json for strict type checking without a compiler?

Configure package.json and tsconfig.json to enable strict type checking and ES module settings. This enforces an end-to-end type-safe workflow across browser and server-side JavaScript without requiring a transpiler.

Does JSDoc work for browser-side type safety without bundling or compiling?

Yes, JSDoc provides browser-side type safety by annotating plain .js files. This delivers IDE support and type checking without the need for bundling, compiling, or transpiling your client libraries.

What are the limitations of using erasable syntax TypeScript in Node.js?

The limitation of erasable syntax TypeScript in Node.js is that you must avoid non-erasable features like enums or namespaces. You are restricted to type-only constructs that do not require transpilation to run.