web-component-analyzer icon indicating copy to clipboard operation
web-component-analyzer copied to clipboard

@default JSDOC always turn into string

Open Sarin-Udompanish opened this issue 4 years ago • 1 comments

Example code

  /**
   * Set the first day of the week. 0 - for Sunday, 6 - for Saturday
   * @param firstDayOfWeek The first day of the week
   * @type {number}
   * @default 0
   */
  @property({ type: Number, attribute: 'first-day-of-week' })
  public set firstDayOfWeek (firstDayOfWeek: number) {
    firstDayOfWeek %= 7;
    const oldFirstDayOfWeek = this._firstDayOfWeek;
    if (oldFirstDayOfWeek !== firstDayOfWeek) {
      this._firstDayOfWeek = firstDayOfWeek;
      this.requestUpdate('firstDayOfWeek', oldFirstDayOfWeek);
    }
  }

Expected output

Property Attribute Type Default Description
firstDayOfWeek first-day-of-week number 0 Set the first day of the week.
0 - for Sunday, 6 - for Saturday

Actual output

Property Attribute Type Default Description
firstDayOfWeek first-day-of-week number "0" Set the first day of the week.
0 - for Sunday, 6 - for Saturday

Sarin-Udompanish avatar Nov 26 '21 03:11 Sarin-Udompanish

me too :(

2bro-ncsoft avatar Aug 10 '23 08:08 2bro-ncsoft