SonarTS
SonarTS copied to clipboard
Rule idea: No useless JSDoc block tags
I want to request a feature.
In TypeScript you can use JSDoc:
/**
* Gets the weekday for a given date
* @param date
* @param {Language} language
* @param format Possible formats are "long" and "short"
* @returns {string}
*/
function getWeekday(date: Date, language: Language, format: Format): string {
return '...';
}
In TypeScript the types are already declared in the method declaration, so @param
and @request
don't provide any additional information, when they don't have a description (like format
in the example).
There should be either all or none @param
tags, so in the example they should persist, but the @returns
tag should be removed. Additionally, it is possible to remove {Language}
which you can do to avoid having to change it twice when you refactor.
Thanks for idea, we will consider it when doing next sprint