Skip to content

Commit

Permalink
Merge pull request #303 from microsoft/deprecated_allow
Browse files Browse the repository at this point in the history
Allow JSDoc deprecated anywhere
  • Loading branch information
Orta Therox authored and sandersn committed Nov 29, 2021
1 parent fed4819 commit a4ce8e1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/dtslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dtslint",
"version": "3.6.13",
"version": "3.6.14",
"description": "Runs tests on TypeScript definition files",
"files": [
"bin",
Expand Down
4 changes: 3 additions & 1 deletion packages/dtslint/src/rules/noRedundantJsdoc2Rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ function walk(ctx: Lint.WalkContext<void>): void {
// @ts-ignore (until support for 4.0 is added)
const jsdocDeprecatedTag = ts.SyntaxKind.JSDocDeprecatedTag || 0;
switch (tag.kind) {
case jsdocDeprecatedTag:
// A deprecated tag always has meaning
break;
case ts.SyntaxKind.JSDocTag: {
const { tagName } = tag;
const { text } = tagName;
Expand All @@ -87,7 +90,6 @@ function walk(ctx: Lint.WalkContext<void>): void {
case ts.SyntaxKind.JSDocCallbackTag:
case ts.SyntaxKind.JSDocThisTag:
case ts.SyntaxKind.JSDocEnumTag:
case jsdocDeprecatedTag:

// Always redundant
ctx.addFailureAtNode(
Expand Down
2 changes: 2 additions & 0 deletions packages/dtslint/test/no-redundant-jsdoc/declarationFile.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @deprecated */
export const x: number;
6 changes: 6 additions & 0 deletions packages/dtslint/test/no-redundant-jsdoc/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rulesDirectory": ["../../bin/rules"],
"rules": {
"no-redundant-jsdoc": true
}
}

0 comments on commit a4ce8e1

Please sign in to comment.