Skip to content

Syntax error in type: string[]= (jsdoc/valid-types) #494

@yvele

Description

@yvele

Writing an optional array parameter with Google Closure Compiler syntax

/**
 * @param {string[]=} foo Description.
 */

Is returning an error

error  Syntax error in type: string[]=  jsdoc/valid-types

But {string[]=} looks valid 🤔 the = character should not be part of the "type"

I'm using

settings : {
  jsdoc : {
    preferredTypes : {
      "Array.<>" : "[]",
      ".<>" : "<>"
    }
  }
},
rules : {
   "jsdoc/check-syntax": "off"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions