Loading...
Loading...
Use when experimenting with TypeScript. Use when migrating JavaScript gradually. Use when adding types to JS files. Use when teams are learning TypeScript. Use when validating JavaScript with types.
npx skill4agent add marius-townhouse/effective-typescript-skills ts-check-jsdoc-experiment@ts-check@ts-check// @ts-check
/**
* @param {string} name
* @param {number} age
* @returns {string}
*/
function greet(name, age) {
return `Hello ${name}, you are ${age}`;
}
greet('Alice', 30); // OK
greet('Alice', '30'); // Type error!
/** @type {string[]} */
const names = ['Alice', 'Bob'];
/** @typedef {{ x: number, y: number }} Point */
/** @type {Point} */
const point = { x: 1, y: 2 };