feat(eslint-plugin) new rule: require @since
annotations
#401
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there! This is work towards resolving nuxt/nuxt#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 😃