Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
Fixes "no-redundant-jsdoc" exception on this tag (#4690)
Browse files Browse the repository at this point in the history
  • Loading branch information
bugsduggan authored and adidahiya committed May 15, 2019
1 parent 3efdfe5 commit 8ef652e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
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

0 comments on commit 8ef652e

Please sign in to comment.