Skip to content

Require JsDoc on validators #44893

Description

@anonrig

What is the problem this feature will solve?

This change will enforce the use of JSDocs in internal validators and make it easier for developers to contribute the validators with correct parameters (and auto-completion)

What is the feature you are proposing to solve the problem?

Using an eslint rule to enforce jsdoc for lib/validators.js

What alternatives have you considered?

Nothing

Activity

  1. Trott commented on Oct 5, 2022

    @Trott
    Member

    We already use eslint-plugin-jsdoc for JSDoc linting. We turn on the recommended rules for it:

    node/.eslintrc.js

    Lines 41 to 42 in e84e2e6

    extends: ['eslint:recommended', 'plugin:jsdoc/recommended'],
    plugins: ['jsdoc', 'markdown', 'node-core'],

    But then we turn a bunch of them off:

    node/.eslintrc.js

    Lines 304 to 314 in e84e2e6

    // JSDoc recommended rules that we disable
    'jsdoc/require-jsdoc': 'off',
    'jsdoc/require-param-description': 'off',
    'jsdoc/newline-after-description': 'off',
    'jsdoc/require-returns-description': 'off',
    'jsdoc/valid-types': 'off',
    'jsdoc/no-undefined-types': 'off',
    'jsdoc/require-param': 'off',
    'jsdoc/check-tag-names': 'off',
    'jsdoc/require-returns': 'off',
    'jsdoc/require-property-description': 'off',

    So maybe enabling one of those disabled rules will accomplish what you are looking for?

  2. Trott commented on Oct 5, 2022

    @Trott
    Member

    Does #44896 do what you are looking for? Or are there validators in other files that you are looking to apply JSDoc comments to?

  3. anonrig commented on Oct 5, 2022

    @anonrig
    MemberAuthor

    Yes this was what I was looking for. Thanks @Trott

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions