Skip to content

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 committed Nov 29, 2021
1 parent 9f32ff9 commit d3ce926
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions packages/dtslint/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 d3ce926

Please sign in to comment.