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
Create require-jsdoc rule #1842
Comments
Can you please provide more details for what you are proposing? Is not clear from your description. |
Sure! I want to make sure that every function gets it's jsDoc block. Maybe this would make more sense in it's own rule. |
We need to figure out which functions because you may not, for example, want jadoc on an iife or on an anonymous function passed into another function. We can probably day function declarations should have jsdoc comments. What else? |
Sounds legit. Thought there might be some issues i did not think about. Maybe we could just start with |
I don't think those are granular enough. Consider: function foo() {
// most likely want to require for this
}
var foo = function() {
// do we want to require for this? It's a FunctionExpression
};
foo(function() {
// this is a FunctionExpression, too.
});
(function() {
// this is a FunctionExpression, too.
}());
// these?
var foo = () => {};
foo(() => {}); |
Ok. I see your point. Is there a way to make more precise decisions? I personally would like the first two to have jsDoc required. Do you think it's worth building a plugin? Or is this just to special? |
We can be more specific, we just have to know what to look for. I like the idea of a |
@nzakas what about starting with all prototype methods and class methods in ES6? Once the feature is up & running, we can figure out other places where it should work. If that's something you'd like to see working, can submit the proposal. |
I think any We may also talk to @nrsedat about his plugin to see if he has any ideas based on his plugin. Some ideas for possible config options we could turn on or off:
|
Hi! I have a PR to run fail eslint on undocumented named functions it's here: #2980 If you'd like to have this issue resolved feel free to comment on the PR. |
New: `require-jsdoc` rule (fixes #1842)
Thanks for creating this rule. Was wondering if I'm missing something here. Shouldn't it be triggered for var promiseRejectError = function() {
return Promise.reject(Error('boom'));
}; The source code seems to mention it, but Thanks |
Yup we do not support |
@gyandeeps Thanks. Any particular rationale? I was wondering about the code in the rule: "FunctionExpression": function(node) {
if (options.MethodDefinition) {
checkClassMethodJsDoc(node);
}
}, |
Are there any plans to support function expressions? It seems very useful when documenting modules. For example, right now there's no way to consider this a problem: module.exports.foo = function foo() {
return 'bar';
} |
+1 on this |
Please open a new issue if you want an enhancement to this rule. Thanks! |
here it is: #5867 |
I would like to have a
requireJsDoc
option for valid-jsdoc. Could befalse
by default but would be nice to enforce jsDoc at all and then of course the correct jsDoc.Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: