Closed luc122c closed 3 months ago
@antfu I would really appreciate some pointers, hopefully I'm on the right track.
Thank you, but I am not sure this plugin is useful to general Nuxt apps. If you mean have it for the Nuxt's core repo, it should goes to https://github.com/nuxt/nuxt/blob/main/eslint.config.mjs, but not here. Thanks.
Oh, I misunderstood. I thought this was the config for the Nuxt core.
Hi there! This is work towards resolving https://github.com/nuxt/nuxt/issues/24950. This PR adds a new rule:
require-jsdoc-since
. The purpose of this rule is to check exported functions and make sure they have a JSDoc with a@since
annotation.Methodology
ExportNamedDeclaration
andExportDefaultDeclaration
TSInterfaceDeclaration
andTSTypeAliasDeclaration
@since
annotationIssues
Because it is looping over all definitions and checking individually, it is not aware of overloads. This leads to cases where a JSDoc defines a function with overloads, but the new rule reports that the overloads are missing valid JSDoc comments.
Any help would be appreciated š
Development
I have made the following modifications to my local copy of Nuxt to test this. If there is a better way to integrate te types, please let me know as I'll need to make a PR to integrate this into Nuxt next :)
Testing
I have created a test file, but I have absolutely no idea how to run it. I would appreciate it if anyone could help š