Skip to content

[match-description] Pattern is not correctly applied (newlines not preserved) #692

Closed
@Shinigami92

Description

@Shinigami92

Expected behavior

No warnings should be printed / detected

I have setup following pattern: "^([A-Z`].*(\\.|:)|-\\s.*)$"

  • Should start with a capital letter or backtick [A-Z`]
  • Followed by anything .*
  • Should end with a period or colon (\\.|:)
  • Or the whole line can be a bullet point (list entry) -\\s.*

Actual behavior

71:0 warning JSDoc description does not satisfy the regex pattern jsdoc/match-description

ESLint Config

    //...
    "jsdoc/match-description": [
      "warn",
      {
        "mainDescription": "^[A-Z`].*\\.$",
        "matchDescription": "^([A-Z`].*(\\.|:)|-\\s.*)$", // This is the pattern I want to apply
        "contexts": ["any"],
        "tags": {
          "param": true,
          "returns": true
        }
      }
    ]
    //...

https://github.com/mib200/vue-gtm/blob/fa0b139417b09c871ae27c629415dea06ec50a49/.eslintrc.json#L49-L60

  /**
   * Enable or disable plugin.
   *
   * When enabling with this function, the script will be attached to the `document` if:
   *
   * - the script runs in browser context
   * - the `document` doesn't have the script already attached
   * - the `loadScript` option is set to `true`
   *
   * @param enabled `true` to enable, `false` to disable. Default: `true`.
   */

https://github.com/mib200/vue-gtm/blob/fa0b139417b09c871ae27c629415dea06ec50a49/src/plugin.ts#L70-L80

Environment

  • Node version: v15.6.0
  • ESLint version v7.20.0
  • eslint-plugin-jsdoc version: 32.0.0

If I do anything wrong on my side, please explain how I can fix it 🙂

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions