hosseinmd / prettier-plugin-jsdoc

A Prettier plugin to format JSDoc comments.
MIT License
232 stars 28 forks source link

How to use in browser? #128

Closed mbforbes closed 2 years ago

mbforbes commented 3 years ago

Apologies for the second question 😅

I'm hoping to run this plugin in the browser, but I'm not sure how to do that.

Following Prettier's Browser guide, I'm able to run plugins that prettier has hosted, like the TypeScript one:

<script type="module">
    import prettier from "https://unpkg.com/prettier@2.4.0/esm/standalone.mjs";
    import parserTS from "https://unpkg.com/prettier@2.4.0/esm/parser-typescript.mjs";
    prettier.format("class Foo {}", {
        parser: "typescript",
        plugins: [parserTS],
    });
</script>

However, I'm not sure how to run this plugin, which doesn't have an all-in-one file exported. I checked out what was installed in node_modules/prettier-plugin-jsdoc/ and I see 13 JavaScript files in the lib/ subfolder. Would they need to be combined in some way?

Again, many thanks for any advice!

hosseinmd commented 3 years ago

Hi, I think that could be done with typescript, I will do it as soon as possible

mbforbes commented 3 years ago

Ahh, amazing, thank you so much! 🙏

mbforbes commented 3 years ago

Hi @hosseinmd, I'm sorry to bother you, but might you know how this could be pulled off? Would be awesome to be able to run your plugin in the browser 😃

hosseinmd commented 2 years ago

V0.3.32 released, check it.

mbforbes commented 2 years ago

Oh wow, awesome, I will check it! Thank you!