-
Notifications
You must be signed in to change notification settings - Fork 5
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
use eslint-plugin-jsdoc #25
Conversation
I rearranged some of the rules so it might be easier to read them. I noticed that only gajus/eslint-plugin-jsdoc#686 really is blocking because the other issues are only blocking rules that were not enforced before and should, at least in the main src/ folder, get checked by tsc anyways. I disabled these rules for now. |
Flashback microsoft/TypeScript#26528 |
Wow, yes that seems like a very similar issue. It might be a little easier though as the comment-parser lib does not handle the type parsing on its own. |
After the changes in openlayers/openlayers#11975 this plugin only produces 2 problems:
and
both can easily be fixed on openlayers side by using Maybe we can remove the |
Thanks for the work on this, @simonseyock. I'm in favor of adding I'm also in favor of removing our use of the custom
Any additional checks that detect missing properties on types etc. would be great. |
I added the typedefs to openlayers/openlayers#11975 The rules which I think might be interesting but I do not have activated at the moment are:
|
+1 for enabling and going with the "typescript" mode
We could include this in a future version when the upstream issue is fixed.
I'd say only enable this if you feel like helping address the problems it reveals. I'll contribute as well.
Same above about including in a future version when the blocking issue is addressed.
If you see value in this one, go for it. Not clear to me how much would have to change to conform (perhaps just changing |
For |
9c81d8b
to
0e25979
Compare
If we remove the google closure syntax we lose the I would just remove the non-nullable types for now and I might crawl through the code and try to fix the issues with the nullable types. |
|
I was actually wrong about the nullable types. I remembered seeing an error earlier, but I was wrong. As the docs state they only flag google closure syntax if it has a meaningful replacement. |
I found that on some occasions the description of a property is indented and on others it is not.
This style would be enforcable by the plugin. Should we use that? Edit: To be more precise, I only saw the indentation only on nested types so far. Also there is a rule which enforces to start all descriptions to start with uppercase and end with |
The mentioned |
I looked more into So if we leave this one out, the only rule left might be |
I think rules that improve the quality of the generated docs make sense to add. Those that improve the legibility of the comments in the code are nice, but could get tedious if there are too many - since I’m guessing we don’t get auto fix. |
Ok, in this case I would consider this PR ready to get merged. Would you mind taking a look at it and releasing a new version of the plugin? |
@tschaub just wanted to ask if this is ready to merge and release then? |
Thanks, @simonseyock. Published as |
This PR introduces
eslint-plugin-jsdoc
as mentioned in openlayers/openlayers#11960At the moment I see 3 problems that will block the use of this plugin:
no-undefined-types
: false positives inside functions for type parameters declared by template tags gajus/eslint-plugin-jsdoc#559This will allow a more rigid checking of the jsdocs. I tried it and it already detected some issues in the codebase, for example missing parameter descriptions or missing
@property
tags.There are several stylistic rules that can be configured but will produce many problems in the codebase initially, but can be fixed easily. For example in the codebase
@return
is used way more often than@returns
so we could check for that.Also this plugin could help to move away from google closure syntax. Mainly
@property {Type=} prop
which could get replaced by@property {Type} [prop]
. Another one is@property {!Type} prop
which in my opinion could either get removed or get replaced by"strictNullChecks": true
in the tsconfig. This produces 1075 issues though.