Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support prettier-plugin-jsdoc #27

Merged
merged 9 commits into from
Jul 20, 2022
Merged

feat: support prettier-plugin-jsdoc #27

merged 9 commits into from
Jul 20, 2022

Conversation

aminya
Copy link
Contributor

@aminya aminya commented Jun 12, 2022

Fixes #21

@CLAassistant
Copy link

CLAassistant commented Jun 12, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aminya and sorry for my delay. Would you be able to add a test for this in the ./tests/specs folder? That way we can ensure this works and keeps working. Thanks!

@dsherret dsherret force-pushed the main branch 2 times, most recently from f995ecc to 7e2fe5a Compare July 2, 2022 00:20
@aminya
Copy link
Contributor Author

aminya commented Jul 3, 2022

I get an error that exports is not defined. I tried to fix it by resolving to ES6 source code. However, It doesn't fix it.

@aminya
Copy link
Contributor Author

aminya commented Jul 3, 2022

I replaced EsBuild with Parceljs. Now, Parceljs correctly bundles the project making it possible to use it in the browser.

I also added a test for JSDoc formatting. All the tests pass.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for figuring this out, @aminya! Also, sorry for my delay.

I made a few changes to this PR in order to make the plugin opt-in since it doesn't seem that popular.

@dsherret dsherret merged commit 79d6715 into dprint:main Jul 20, 2022
@aminya
Copy link
Contributor Author

aminya commented Jul 20, 2022

Thanks for merging.

I don't mind the opt-in option, but I think JSDoc is way more popular than Astro and Svelte. So the options are inconsistent.

@dsherret
Copy link
Member

I was thinking both astro and svelte would be opt-in by asking the dprint-plugin-prettier plugin to format svelte/astro files or not? In the case of jsdoc it's intertwined in the js output.

@aminya
Copy link
Contributor Author

aminya commented Jul 21, 2022

Well, prettier-plugin-jsdoc also only works if the user uses TSDoc or JSDoc for documentation. The nature of the existence of a file format doesn't justify the feature. Or we could go the other way and enable all of them. As long as people can disable them, it should be fine.

@dsherret
Copy link
Member

I’d rather this format TypeScript and JavaScript files out of the box the same way as prettier does, then people can opt in to the jsdoc plugin to change how ts/js files are formatted if they would like similar to how they have to opt in with prettier. Actually, maybe the option configuration should have the same structure as prettier does and be an array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugin: prettier-plugin-jsdoc
3 participants