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

Add 'no-redundant-jsdoc' rule #2754

Merged
merged 4 commits into from Oct 20, 2017

Conversation

andy-hanson
Copy link
Contributor

PR checklist

  • Addresses an existing issue: #0000
  • New feature, bugfix, or enhancement
    • Includes tests
  • Documentation update

Overview of change:

Adds the no-redundant-jsdoc rule, which forbids unnecessary redundant JSDoc, as in:

/**
 * @export
 * @function
 * @name f
 * @param {number} x
 * @returns {void}
 */
export function f(x: number): void;

CHANGELOG.md entry:

[new-rule] no-redundant-jsdoc

}
}

declare module "typescript" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't do that
that should be done upstream in typescript. IIRC there's already an issue with a feature request for something like node.getJsDoc()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, let's wait for this to be fixed upstream.

}
}

declare module "typescript" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, let's wait for this to be fixed upstream.

}

function isRedundantTag(tagName: string): boolean {
switch (tagName) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps keeping a Set of these would be a little more efficient & less code?

@ajafff
Copy link
Contributor

ajafff commented Sep 26, 2017

@andy-hanson are you still interested in getting this merged?

Since the jsDoc property is still not public in typescript, I added two utility functions to the latest version of tsutils to deal with JsDoc: canHaveJsDoc and getJsDoc.

If you don't want to continue here, just leave me a message if you are ok with me finishing your PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants