JSDoc applied to methods tend to age. Typically method parameters are added / removed / changed but their documentation remain unchanged.
Typescript compiler should check the @param names and should write an error, if they are not found in the method signature. Maybe this check should be optional, by a compiler flag.
TypeScript Version: (2.0.3)
Code
class TestValidateJSDocParams {
/** Calculate the sum of the given numbers
* @param x first summand
* @param y second summand
* @param z third summand
*/
public sum (a: number, b: number) : number {
return a + b;
}
}
Expected behavior:
Should log an tsc compiler error for unknown methods parameters: x, y, z
Actual behavior:
Compiles without an error.
JSDoc applied to methods tend to age. Typically method parameters are added / removed / changed but their documentation remain unchanged.
Typescript compiler should check the @param names and should write an error, if they are not found in the method signature. Maybe this check should be optional, by a compiler flag.
TypeScript Version: (2.0.3)
Code
Expected behavior:
Should log an tsc compiler error for unknown methods parameters: x, y, z
Actual behavior:
Compiles without an error.