Skip to content

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

Closed
wants to merge 0 commits into from

Conversation

czb3279338858
Copy link
Contributor

@czb3279338858 czb3279338858 commented Sep 28, 2022

Fixes #1993

const utils = require('../utils')

// ------------------------------------------------------------------------------
// Helpers
Copy link
Member

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.

Comment on lines 29 to 37
/**
* a comment
*/
a: Number,
// b comment
b: Number,
// c
// comment
c: Number
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

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.

@FloEdelmann FloEdelmann changed the title require-prop-comment Add new require-prop-comment rule Sep 30, 2022
@ota-meshi ota-meshi marked this pull request as draft October 4, 2022 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

require-prop-comment
2 participants