diff --git a/src/rules/noRedundantJsdocRule.ts b/src/rules/noRedundantJsdocRule.ts index b249d8abac6..3b7dc681fd9 100644 --- a/src/rules/noRedundantJsdocRule.ts +++ b/src/rules/noRedundantJsdocRule.ts @@ -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: diff --git a/test/rules/no-redundant-jsdoc/test.ts.lint b/test/rules/no-redundant-jsdoc/test.ts.lint index b22e99be1bd..2b0becdb727 100644 --- a/test/rules/no-redundant-jsdoc/test.ts.lint +++ b/test/rules/no-redundant-jsdoc/test.ts.lint @@ -1,8 +1,11 @@ /** @typedef {number} T */ ~~~~~~~ [tag % ('typedef')] -/** @function */ +/** @function ~~~~~~~~ [tag % ('function')] + * @this + ~~~~ [tag % ('this')] + */ function f() {} /** @type number */ @@ -12,6 +15,8 @@ const x = 0; /** * @class ~~~~~ [tag % ('class')] + * @this {} + ~~~~ [tag % ('this')] * @param {number} x Is a number ~~~~~~~~ [type] * @param y @@ -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 @@ -38,7 +49,7 @@ declare function h(x: number): number; #endif * @template V Some additional information */ -declare function i(x: T, y: V): U; +declare function j(x: T, y: V): U; [tag]: JSDoc tag '@%s' is redundant in TypeScript code. [type]: Type annotation in JSDoc is redundant in TypeScript code.