tsdoc icon indicating copy to clipboard operation
tsdoc copied to clipboard

param hyphen warning

Open chnliquan opened this issue 2 years ago • 7 comments

the vscode use jsdoc to default IntelliSense, it will not generate hyphen minus in @param. if manually adding hyphen minus has a lot of cost, can you provide a configuration item to turn off the hyphen minus check

chnliquan avatar Mar 07 '22 07:03 chnliquan

This already exists I think - You can turn off tsdoc-param-tag-missing-hyphen in your api-extractor.json config file. Then you won't get warnings/errors for missing hyphens in @param tags.

https://github.com/microsoft/tsdoc/blob/e66ec2ca2fe453d53bae9bfe6fc62de7e4c2aef4/tsdoc/src/parser/TSDocMessageId.ts#L161

zelliott avatar Apr 08 '22 22:04 zelliott

I would love to see a solution for the hyphen warning. I only intend to use the plugin for linting so the extractor solution is of no use. This issue is present in several issues without a solution being present. The hyphen rule issue is rather unfortunate as the default snippet in vsCode does not contain a hyphen so users will generally not insert one, making the plugin time-consuming to use.. I think the issue of configuring the rules is likely to limit the use of this plugin.

4Tel-SteveM avatar Jan 24 '23 01:01 4Tel-SteveM

Maybe it is better to fix the snippet in VS Code. If the standard asks for it, then the warning IMHO should stay.

crystalfp avatar Mar 04 '23 17:03 crystalfp

I'm migrating a project from jsdocs to tsdocs. I have like 3000 missing hypen warnings. Is there a way to fix this using lint's --fix flag? If the only thing that is missing is the hypen it should be an easy fix, just like extra space at the end of the line rule...

HarelM avatar Jul 02 '23 20:07 HarelM

Also there's no way to disable a single rule, much like done with other lint tools. So if I have a warning I would like to suppress, I can't do it. I also am not using the api-extractor, instead I'm using dts-bundle-generator, which is a lot easier to setup... Currently all I can do is turn this off completely as I have like 1K warnings...

HarelM avatar Jul 05 '23 12:07 HarelM

Just stumbled upon the same. In a large codebase like ours where we have thousands upon thousands of jsdocs, its not very practical to add hyphens manually. Either there should be an option to configure it or a way to auto fix. Not very practical for large scale adoption.

itssumitrai avatar Mar 21 '24 18:03 itssumitrai

Just stumbled upon the same. In a large codebase like ours where we have thousands upon thousands of jsdocs, its not very practical to add hyphens manually. Either there should be an option to configure it or a way to auto fix. Not very practical for large scale adoption.

Probably the best approach would be a combination of:

  1. Provide a command similar to ESLint --fix that would automatically rewrite comments to use normalized TSDoc form
  2. Implement a VS Code extension that provides correct IntelliSense and previews for TSDoc comments. This would provide a generalized solution for all the issues where VS Code incorrectly parses TSDoc (because VS Code does not follow any formal syntax standard, it just makes a best guess based on commonly observed coding patterns)

octogonz avatar Mar 21 '24 19:03 octogonz