Skip to content

allow more "require" for fields #717

@lublak

Description

@lublak

Motivation

To better enforce documentation straight for fields.

Current behavior

Currenlty it is impossible to force this behaviour (@type for fields):

https://jsdoc.app/tags-type.html

Currently if i use match-description

"jsdoc/match-description": [
    "error",
    {
        "matchDescription": "^[a-zA-Z0-9_\\- /\\\\()[\\]{}=?!:.,;*+~#'\"%&<>|]+$",
         "contexts": [
               "any"
         ]
    }
],

but this does not work (as a side note: this also does not apply to the class description).

the require-jsdoc works fine:

"jsdoc/require-jsdoc": [
    "error",
    {
        "publicOnly": true,
        "require": {
            "ArrowFunctionExpression": true,
            "ClassDeclaration": true,
            "ClassExpression": true,
            "FunctionDeclaration": true,
            "FunctionExpression": true,
            "MethodDefinition": false
        },
        "contexts": [
            "MethodDefinition:not([accessibility=\"private\"]) > FunctionExpression",
            "ClassProperty:not([accessibility=\"private\"])",
            "TSPropertySignature"
        ]
    }
],

Desired behavior

I want to force fields to have a description and what type they contain.

Alternatives considered

The only alternative is to control it manually.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions