Skip to content

New rule: informative-docs #1000

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Motivation

Devs will often write JSDoc descriptions that add no additional information just to fill out the doc:

/**
 * Request metadata.
 */
interface RequestMetadata {
    /**
     * The user id.
     */
    userId: string;
}

Current behavior

There's no rule I could find that lints against a description that exists & has more than a minimum number of characters, but only includes meaningless words.

Desired behavior

It'd be nice to have a rule that requires the documentation for something not be equivalent to just the thing's name. If we strip out non-alphabet characters, common words such as "the" or "a", and lowercase everything, they shouldn't be the same.

I'd previously added this to tslint-microsoft-contrib and would love to do the same here! microsoft/tslint-microsoft-contrib#555

Alternatives considered

🤷

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions