Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/rules/noRedundantJsdocRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function walk(ctx: Lint.WalkContext): void {
break;

case ts.SyntaxKind.JSDocClassTag:
case ts.SyntaxKind.JSDocThisTag:
case ts.SyntaxKind.JSDocTypeTag:
case ts.SyntaxKind.JSDocTypedefTag:
case ts.SyntaxKind.JSDocPropertyTag:
Expand Down
17 changes: 14 additions & 3 deletions test/rules/no-redundant-jsdoc/test.ts.lint
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/** @typedef {number} T */
~~~~~~~ [tag % ('typedef')]

/** @function */
/** @function
~~~~~~~~ [tag % ('function')]
* @this
~~~~ [tag % ('this')]
*/
function f() {}

/** @type number */
Expand All @@ -12,6 +15,8 @@ const x = 0;
/**
* @class
~~~~~ [tag % ('class')]
* @this {}
~~~~ [tag % ('this')]
* @param {number} x Is a number
~~~~~~~~ [type]
* @param y
Expand All @@ -25,11 +30,17 @@ const x = 0;
*/
declare function g(x: number, y: number, z: number): number;

/**
* @this {SomeClass}
~~~~ [tag % ('this')]
*/
declare function h();

/**
* @param x Useful comment
* @returns Useful comment
*/
declare function h(x: number): number;
declare function i(x: number): number;

/**
* @template T, U
Expand All @@ -38,7 +49,7 @@ declare function h(x: number): number;
#endif
* @template V Some additional information
*/
declare function i<T, U, V>(x: T, y: V): U;
declare function j<T, U, V>(x: T, y: V): U;

[tag]: JSDoc tag '@%s' is redundant in TypeScript code.
[type]: Type annotation in JSDoc is redundant in TypeScript code.
Expand Down