Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Add @see tag (#310)
Browse files Browse the repository at this point in the history
* Add support for @see tag

Also fix no-redundant-jsdoc2 test. It was not testing anything before.

* Move test to correctly named folder
  • Loading branch information
sandersn authored Sep 18, 2020
1 parent 5c36c59 commit e609d63
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/rules/noRedundantJsdoc2Rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ function walk(ctx: Lint.WalkContext<void>): void {
});

function checkTag(tag: ts.JSDocTag): void {
// @ts-ignore (until support for 4.0 is added)
const jsdocDeprecatedTag = ts.SyntaxKind.JSDocDeprecatedTag || 0;
const jsdocSeeTag = (ts.SyntaxKind as any).JSDocSeeTag || 0;
const jsdocDeprecatedTag = (ts.SyntaxKind as any).JSDocDeprecatedTag || 0;
switch (tag.kind) {
case jsdocSeeTag:
case jsdocDeprecatedTag:
// A deprecated tag always has meaning
// @deprecated and @see always have meaning
break;
case ts.SyntaxKind.JSDocTag: {
const { tagName } = tag;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/** @deprecated */
export const x: number;
/** @see x */
export const y: number;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"rulesDirectory": ["../../bin/rules"],
"rules": {
"no-redundant-jsdoc": true
"no-redundant-jsdoc2": true
}
}

0 comments on commit e609d63

Please sign in to comment.