Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

jsdoc-format rule fails if file starts with JsDoc comment. #2505

Closed
karan-kang opened this issue Apr 5, 2017 · 2 comments · Fixed by #2619
Closed

jsdoc-format rule fails if file starts with JsDoc comment. #2505

karan-kang opened this issue Apr 5, 2017 · 2 comments · Fixed by #2619
Milestone

Comments

@karan-kang
Copy link

karan-kang commented Apr 5, 2017

Bug Report

  • TSLint version: 5.0.0
  • TypeScript version: 2.2.2
  • Running TSLint via: CLI

TypeScript code being linted

/**
 * Singular representation of date time input field values
 * @param {Date} dateValue Date value
 * @param {Date} timeValue Time value
 */
export class DateTimeResult {
    constructor(private dateValue: Date, private timeValue: Date) {
    }
    ....
}

with tslint.json configuration:

tslint:recommended

Actual behavior

ERROR: src/dateRangePicker/dateTimeResult.ts[1, 6]: asterisks in jsdoc must be aligned
ERROR: src/dateRangePicker/dateTimeResult.ts[2, 59]: asterisks in jsdoc must be aligned
ERROR: src/dateRangePicker/dateTimeResult.ts[3, 37]: asterisks in jsdoc must be aligned
ERROR: src/dateRangePicker/dateTimeResult.ts[4, 36]: asterisks in jsdoc must be aligned

Expected behavior

No JsDoc error

Workaround

Add a blank line at the top of the file.

@ajafff
Copy link
Contributor

ajafff commented Apr 6, 2017

@Karankang007 I guess your file has a BOM? That would explain why the rule sees the asterisks in different columns

@karan-kang
Copy link
Author

@ajafff Yes, I am using VS 2015, which saves this with BOM by default. Either way, i think TSLint should ignore BOM characters when checking any rules.

@adidahiya adidahiya added this to the TSLint v5.3 milestone May 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants