tsdoc
tsdoc copied to clipboard
tsdoc-param-tag-missing-hyphen asks for hyphen but tests for hyphen-minus
Example (line 10: hyphen-minus, line 11: hyphen):
/**
* Locale representing language and region.
*
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale
* @see https://github.com/microsoft/TypeScript/issues/37326
*/
export class Locale {
/**
*
* @param _language - the language of the `Locale`
* @param _region – the region of the `Locale` or `null`
*/
constructor(private _language: string, private _region: string | null) {}
[…]
> eslint . --ext .ts
/[…]/src/locale.ts
11:6 warning tsdoc-param-tag-missing-hyphen: The @param block should be followed by a parameter name and then a hyphen tsdoc/syntax
✖ 1 problem (0 errors, 1 warning)
In fact it tests for TokenKind.Hyphen which is a hyphen-minus.
Strictly speaking the character "–" on line 11 is an en dash, not a hyphen, Unicode 2013. There is a distinct Unicode hyphen character, 2010 or "‐", which I assume would also not pass this lint rule, but hyphen-minus is definitely in far wider use, and I think most people would default to using it, if only because it's on most keyboards and in ASCII.