TS8020
JSDoc types can only be used inside documentation comments.
Broken Code ❌
function add(a: number, b: number, c: number?): number {
return a + b;
}Fixed Code ✔️
If you wanted to make c optional:
function add(a: number, b: number, c?: number): number {
return a + b;
}If you wanted to document c with JSDoc:
/**
* @param a Initial quantity
* @param b Amount to add
* @param [c] Optional number to add
*/
function add(a: number, b: number, c: number): number {
return a + b;
}