SonarTS icon indicating copy to clipboard operation
SonarTS copied to clipboard

Rule idea: No useless JSDoc block tags

Open xxluke opened this issue 5 years ago • 1 comments

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.

xxluke avatar Mar 04 '19 11:03 xxluke

Thanks for idea, we will consider it when doing next sprint

vilchik-elena avatar Mar 04 '19 14:03 vilchik-elena