Open prescience-data opened 2 years ago
The approach of experimental-jsdoc-to-tsdoc-tool
seems pretty good. Thanks for sharing that link BTW -- I wasn't aware of it!
I'd also be in favor of providing an ESLint "fixer" so that comments can be converted without having to install and invoke a separate CLI tool. For big bulk conversions, the CLI tool is maybe a superior approach (since it can have more options and controls), but certainly for quick fixes the ESLint integration would be handy.
For details about how ESLint fixers are defined, see these docs.
I probably don't have time to work on this myself, but if someone else wants to a contribute a PR, I can help with the design & approval.
someone else wants to a contribute a PR, I can help with the design & approval.
Is there a style guide for the tsdoc
repo that should be referenced for PRs?
I'm tinkering around to see if this is possible but would love to avoid going down a rabbit hole if not likely to work.
https://github.com/wvbe/experimental-jsdoc-to-tsdoc-tool
I've been using a local version of this library to convert any
jsdoc
blocks autogenerated by a team member's IDE totsdoc
prior to calling@microsoft/api-extractor
and beforeeslint --fix
in CI.It would be awesome if there was an experimental/opt-in way to have
eslint-plugin-tsdoc
(which already has identified the problem blocks) to auto-convertjsdoc
comments to theirtsdoc
equivalent (and remove non-conforming tags) in real-time via the IDE'seslint
integration.I've been encouraged by the way eslint-plugin-prefer-arrow seems to be able to rewrite
function foo() {}
toconst foo = () => {}
reliably, but haven't dug deep enough intoeslint
to be sure the scenario described above is feasble.Separate from any sort of official support or implementation - does this sound like something that is actually possible with
eslint
?