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
1) We could add it to the eslint-plugin/configs installing the current package. In some moment we can also open a new PR for eslint-plugin-jsdoc and when they accept, we could uninstall the package and just update the configuration to use the new rule from eslint-plugin-jsdoc.
2) We could migrate the rule to eslint-plugin/rules and add to the eslint-plugin/configs. I particularly don't like that, because it makes the plugin restrict only to eslint-plugin.
3) We could migrate the 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 the eslint-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.
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 @wordpress/eslint-plugin package.
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 eslint-plugin-jsdoc package.
@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
@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 https://github.com/gajus/eslint-plugin-jsdoc/pull/636 for the eslint-plugin-jsdoc.
Most helpful comment
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
eslint-plugin-jsdocpackage.