-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Eslint rule for JSDoc alignment #24984
Comments
I lean towards option 1 as well assuming the pr is created for the upstream project. Otherwise, if this is something WP specific and/or it doesn't look like the upstream repo will accept, I think it would be good to add a custom rule in the |
We discussed this a bit in the Core JavaScript office hours today. Agreement was the best next step is to try to contribute this as a new rule to the |
@aduth left a follow up comment pointing out this prettier plugin that might be able to enforce alignment for us: https://www.npmjs.com/package/prettier-plugin-jsdoc |
Cool! Thank you for the suggestion! I tried install it in the Sensei LMS repo, but trying to reformat all code, some errors happened. I created a note here to dig into that in the future. =) |
If someone is interested in follow, I created a PR gajus/eslint-plugin-jsdoc#636 for the |
Is your feature request related to a problem? Please describe.
Currently, there is no Eslint plugin for check JSDoc alignment (at least I didn't find one in my researches 😁), as recommended in the WordPress standards.
Describe the solution you'd like
We created a new plugin to check JSDoc alignments (eslint-plugin-jsdoc-alignment). As it can be useful by WordPress community in general, @nerrad gave a good idea to add it to the
@wordpress/eslint-plugin
. So, before proceeding, it'd be good to discuss the approach to be used for that.Things to consider:
@wordpress/eslint-plugin
.Describe alternatives you've considered
eslint-plugin-jsdoc
.eslint-plugin/configs
. I particularly don't like that, because it makes the plugin restrict only toeslint-plugin
.eslint-plugin-jsdoc-alignment
to be a Gutenberg package (we could also make it for the other current Gutenberg generic rules), and install it in theeslint-plugin/configs
. So devs that want use only some specific rule, can install it separately.IMHO, the option 1 looks the more "organized", looking to the future with the contribution being accepted by
eslint-plugin-jsdoc
. It doesn't exclude the option to transform the other Gutenberg generic rules to Gutenberg packages.The text was updated successfully, but these errors were encountered: