-
-
Notifications
You must be signed in to change notification settings - Fork 681
Add new require-prop-comment
rule
#1994
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
Conversation
lib/rules/require-prop-comment.js
Outdated
const utils = require('../utils') | ||
|
||
// ------------------------------------------------------------------------------ | ||
// Helpers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove unneeded comment blocks.
docs/rules/require-prop-comment.md
Outdated
/** | ||
* a comment | ||
*/ | ||
a: Number, | ||
// b comment | ||
b: Number, | ||
// c | ||
// comment | ||
c: Number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should single-line comments really be considered "good"? When documenting props is the goal, I think JSDoc comments should be preferred over single-line comments.
Probably also documentation generator tools will ignore single-line comments. What's your opinion about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think JSDoc comments should be preferred over single-line comments too.
The second parameter will provide a choice,line 、block or unlimited
I am thinking about the following questions
1.Can I mix them?
2.Need to limit the quantity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the rule should only consider JSDoc comments (/** */
) and ignore block comments (/* */
) and line comments //
. No need to limit the number then, since only the JSDoc comment immediately before the statement will be considered.
Fixes #1993